All Forums Database
samsterling 10 posts Joined 06/09
10 Jun 2015
HEX string to Binary bits

We have a HEX value and we need to parse it to a binary string.
I was looking at GETBIT and TO_NUMBER and FROM_BYTES, but I don't seem to be able to figure this out.  One of the errors I get is Conversion from BYTE and other data types is illegal.
We could do this as a UDF, but it seems that there should already be a function something like HEX_TO_BITS.
Any suggestions would be welcome.

CarlosAL 512 posts Joined 04/08
11 Jun 2015

If your HEX value is in a string (VARCHAR, CLOB) and yoy need a VARBYTE or BLOB as output, maybe TO_BYTES() is what you're looking for.

You must sign in to leave a comment.