Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: BITAND with large integers
"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