Is there a way to use hex constants as integers in Derby?

I tried using X'7FFF' and I got "Comparisons between 'SMALLINT' and 'CHAR () FOR BIT DATA' are not supported". I tried using CAST(X'7FFF' AS INTEGER) and got "Cannot convert types CHAR () FOR BIT DATA to INTEGER".

I can of course use 32767 in this case, but for other hex values it's a real pain to work out what it corresponds to. Or I could define a function to convert a string hex value to an integer, but that also seems like overkill.

Thanks,
--
John English

Reply via email to