October 4th, 2002, 01:48 PM
Storing large numbers in oracle
my friend is facing a problem and as i haven't done much work in oracle so thought to post question here.... these are her words:
i have to store a phone number in database and i declared it as "phone number(20,0)", but the problem is that whenever a number having width of more than 15 digits is stored oracle converts the number in exponent and stores so when i retrieve i get first 15 digits correct and after that all 0s. one option is to store phone number as a string but i dun want to do it until n unless its the only way out......so is there ne way of storing the number of size 20 without it being converted to exponent???
October 4th, 2002, 03:01 PM
Maybe you should try storing it in a CHAR or VARCHAR field instead?
October 4th, 2002, 08:49 PM
Re: Storing large numbers in oracle
I have done a lot of work with Oracle and I find this VERY hard to believe, it's probably the way it is being formatted when she displays it.
October 6th, 2002, 06:03 PM
Uh, I just had a 2 minute play, with this code:
So it looks like there's no problem with Oracle's handling of large numbers.
SQL> create table tryx1(
2 val NUMBER(30)
SQL> insert into tryx1 (val) values (12345678901234567890);
1 row created.
SQL> select val, to_char(val, '99999999999999999999') from tryx1;
SQL> drop table tryx1;
Perhaps it's the mechanism you're using to read out the data?