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: BITAND with large integers

Re: BITAND with large integers

From: Matt <not_at_this.address.com>
Date: Tue, 23 Dec 2003 17:02:30 +1100
Message-ID: <3fe7d9f2$0$18390$afc38c87@news.optusnet.com.au>

"Raj Jamadagni" <rajsun_no_spam_at_email.com> wrote in message news:_OSdnamkiOTr-HqiRVn-ug_at_comcast.com...
> Matt,
>
> how about something like this ....
> SELECT 4,POWER(2,31),
> TO_NUMBER(utl_raw.cast_to_varchar2(utl_raw.bit_and(utl_raw.cast_to_raw(4),
> utl_raw.cast_to_raw(POWER(2,31))))) FROM dual
> /
> Raj
>
>

Raj

Thanks for the suggestion.

I'll give it a try. I'll read up on Oracle documentation of utl_raw.bit_and and cast_to_raw to make sure casting to raw and then applying bit_and does what I expect it to do.

My initial concern is this. Does utl_raw.cast_to_raw(POWER(2,31)) result in an integer that allows bit_and to be applied meaningfully? If it just results a raw value in the Oracle NUMBER format then I think there might be unexpected results if the bit_and operation is applied.

However, it's worth a try.

Matt Received on Tue Dec 23 2003 - 00:02:30 CST

Original text of this message

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