I would like to convert a hex string representation to the corresponding INTEGER value.
select cast(hextobin('A') as int) from dummy;
Could not execute 'select cast(hextobin('A') as int) from dummy' in 34 ms 902 µs .
SAP DBTech JDBC: : invalid number: '0A' at function to_int()
I know that the next statement works, but 0xA is already binary and I guess implicite typeconversion just parses the token to integer without typecasting.
select cast(0xA as int) from dummy;
Many thanks in advance,
PS: The background is that I'm searching a way to hash a string value with hash_sha256 to number format (like ORA_HASH in oracle db). I've not found a way to typecast varbinary to number. Instead I try to convert to hex representation first and then convert to integer.