SET @string := '1a4b';
SELECT CONV(@string,16,10);
+-+
| CONV(@string,16,10) |
+-+
| 6731
Thanks. That works perfectly.
Much appreciated.
On February 28, 2010, Michael Dykman wrote:
It's still a string, but this should accomplish what you
Oops: This little bit doesn't make sense, logically: "The hex string is
in little endian byte order (since it represents a 2-byte integer or
short)"... What I was trying to say is that the integer that this hex
string represents is multi-byte, so the order of the hex bytes **is**
important..
Oops: This little bit doesn't make sense, logically: "The hex string is
in little endian byte order (since it represents a 2-byte integer or
short)"... What I was trying to say is that the integer that this hex
string represents is multi-byte, so the order of the hex bytes **is**
important..
I've tried several ways to get my hex-encoded string representation of
an integer to convert back to an integer, but none of them work (the
input string '1a4b' should evaluate to 6731):
(Note that this is not an endianness problem. The hex string is in
little endian byte order (since it rep