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: Decimal to binary conversion? How?

Re: Decimal to binary conversion? How?

From: Darryl <djjr_at_ix.netcom.com>
Date: 2000/06/04
Message-ID: <393B0473.36096844@ix.netcom.com>#1/1

Should have been more specific, I need to convert base 10 numbers to base 2.
3 in decimal sould convert to 011 in binary. Trying to avoid writing my own function.

spencer wrote:

> PL/SQL has a datatypes BINARY_INTEGER
> and PLS_INTEGER which are "binary numbers".
> These datatypes are specific to PL/SQL, the
> Oracle database uses datatype NUMBER for
> handling numeric data.
>
> DECLARE
> li_mybin BINARY_INTEGER ;
> ln_mydec NUMBER(15) := 123;
> BEGIN
> li_mybin := ln_mydec;
> END;
>
> "Darryl" <djjr_at_ix.netcom.com> wrote in message
> news:393AE8C8.A78638D7_at_ix.netcom.com...
> > Is there any way in sql or PL/SQL to convert a Decimal Number
 to a
> > Binary Number.
> >
> > Couldn't find anything in the documentation.
> >
> > Thanks in advance
> >
> >
Received on Sun Jun 04 2000 - 00:00:00 CDT

Original text of this message

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