• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help in Oracle!

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic