|
|
Archives of the TeradataForum
Message Posted: Wed, 28 May 2008 @ 15:42:27 GMT
Subj: | | Re: Hexadecimal to binary conversion |
|
From: | | Geoffrey Rommel |
| Appreciate if someone has teradata code to convert hexadecimal to binary representation | |
We need more specifics. Is the input printable "hex" characters? For example, '00', '1c', 'FF' are two-character strings that could be
interpreted as "hexadecimal".
Is it characters of any kind (anything can be represented as hex)? For example, 'A' is x'41', BACKSPACE is x'08', LATIN SMALL LETTER Y WITH
DIAERESIS is x'FF'.
Is it integers (e.g. 0, 28, 255)?
Is it only one or two characters, or can it be any length?
If you only need to convert one or two characters, the easiest way is to create a small lookup table with the conversions and join to that. If
you need to convert longer strings, a UDF might be called for.
| |