Steven,

For decimal to hex, a to_char function using the "X" element can be used.
There are certain restrictions -- refer to the Number Formats table in the
SQL manual for more info. Here is an example:

  1* select to_char(10,'XXX') from dual
SQL> /

TO_C
----
   A

For a more robust solution that goes both ways, and, deals with conversions
between various bases, take a look at:

http://govt.oracle.com/~tkyte/hexdec/index.html


Regards,

Larry G. Elkins
[EMAIL PROTECTED]
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Steve Haas
> Sent: Thursday, June 14, 2001 4:02 PM
> To: Multiple recipients of list ORACLE-L
> Subject: number to binary conversion
>
>
> Good afternoon,
>
> I have seen on this list some time ago PL/SQL to convert a number to/from
> decimal and hex.
> Does anyone have PL/SQL to convert a number to/from a binary
> representation?
>
> TIA,
>
> Steven Haas
> Opus Consultants, LLC
> "Opinions expressed, right or wrong, are my own."

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Larry Elkins
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to