Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL function to output number as hexadecimal string?
rawtohex will not convert numbers in hexadecimal, it simply displays in hex the internal storage of the number.
I assume you want 11 (dec) -> B (hex)
select rawtohex(11) from dual gives C10C
q.v.
select dump(11,16) from dual;
There is a decimal to hex converter on my web-site, but this was not written to be particularly efficient.
Thomas Kyte has also published on this newsgroup a 'base N to base M' generic conversion package which you might find through www.dejanews.com
--
Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk
>James Lorenzen <james_lorenzen_at_allianzlife.com> wrote in message
>>
>> If you are not adverse to imbeded select statements, the following will
>> function:
>> SELECT RAWTOHEX(value_to_translated) INTO hex_result_in_char FROM dual ;
>>
Received on Fri Jul 23 1999 - 03:47:49 CDT