Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> FW: FW: bitand functions and NUMBER(20)
It starts giving bad results somewhere between 9199999999999999999 and 9299999999999999999.
SQL> c/93/92
1* select bitand(9999999999999999999,9299999999999999999) value from dualSQL> r
1* select bitand(9999999999999999999,9299999999999999999) value from dual VALUE
---------------------
SQL> c/92/91
1* select bitand(9999999999999999999,9199999999999999999) value from dualSQL> r
1* select bitand(9999999999999999999,9199999999999999999) value from dual VALUE
---------------------
09199999999999999999 <---- correct
-----Original Message-----
From: Mark W. Farnham [mailto:mwf_at_rsiz.com]
Sent: Thursday, July 19, 2007 2:03 PM
To: 'Stefan Kuhn'
Subject: RE: FW: bitand functions and NUMBER(20)
I'm getting the same results as you with all the to_numbers supplied.
This is also interesting: (That 9223372036854775807 value is clearly some internal overflow maximum). I think you've found a bug unless I'm missing something.
1* select 19999999999999999999+1 value from dual VALUE
---------------------
20000000000000000000
SQL> r
1* select bitand(1999999999999999999,1999999999999999999) value from dual VALUE
---------------------
01999999999999999999
(19 digits works just fine)
SQL> c/9,/99,
1* select bitand(19999999999999999999,1999999999999999999) value from dualSQL> c/9)/99)
1* select bitand(19999999999999999999,19999999999999999999) value fromdual
1* select bitand(19999999999999999999,19999999999999999999) value fromdual
VALUE
---------------------
(twenty digits gets this answer.)
So other than Oracle fixing the bug or you using smaller values (two columns or something), you would have to use string manipulation of the character value of the number and carve it up for the bitand and concatenate the results.
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jul 19 2007 - 13:23:59 CDT
![]() |
![]() |