Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL function to output number as hexadecimal string?

Re: PL/SQL function to output number as hexadecimal string?

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 23 Jul 1999 09:47:49 +0100
Message-ID: <932721153.171.1.nnrp-13.9e984b29@news.demon.co.uk>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US