It's not a secret anymore!
The moose likes Oracle/OAS and the fly likes Help in Oracle! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Help in Oracle!" Watch "Help in Oracle!" New topic

Help in Oracle!

Sree Nivas
Ranch Hand

Joined: Jul 24, 2003
Posts: 95
Oracle Gurus,

Please provide some help!

We have an issue in storing data into columns with datatype number and exceeds a length of 16.
In our database the creditcardnumber is number(22).
When we store numbers with length beyond 15 digits it changes to the exponential format.
eg if the credit card number is 2222222222222222 the storage is like 2.22222222222222E15.
When we retrieve based on the credit card number there is no matching records found.
We would like to know how we can store numbers in columns whose length exceeds number(15) .
In our system as per the standards all Id columns are number(38) . We might face the same problem even while storing the id.

Thanks & Best regards,
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33098

I would suggest storing the credit card number as varchar(16). Where did the 22 come from anyway? I thought credit cards numbers were 16 characters?

I favor using varchar over number because a credit card number is really a series of characters that happen to all be digits. You can't perform numerical operations, like addition, on credit card numbers.

For the id, it may be valid to use a number. Note that the display in exponential form doesn't necessarily preclude a higher precision value from being stored.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Help in Oracle!
jQuery in Action, 3rd edition