File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Help in Oracle!" Watch "Help in Oracle!" New topic
Author

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,
Sreenivas
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30758
    
156

Sree,
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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help in Oracle!