Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling Credit Card Numbers - field limits

Status
Not open for further replies.

emallon

Programmer
Jul 6, 2000
31
0
0
US
My report takes the credit card number from an oracle database and simply places it on the report. The problem is for each MasterCard or Visa account(16 digits) the last digit is being changed. For AMEX accounts (15 digits) the number appears fine.

Is there a numeric field size limit? Could the 16 digits be bordering the size of a "Double" field length?
 
Are you seeing all of the digits. Crystal (by default) will chop off digits if you don't allow enough room.

Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Yes all digits are showing. The last digit for MasterCard and Visa accounts is being changed.

I.E. MC acct# 5454545454545454 appears in database but appears as follows
5454545454545451 in report.
 
I don't know the reason for it, but SCR does lose precision for 16 and 17 digit numbers. It defaults to scientific notation for 18 digit numbers - but the greatest precision for that format is 11 digits.
As a workaround, I would suggest casting the number field as a character field in Oracle prior to letting SCR get its hands on it. Malcolm
 
Malcolm,
I confirm your thoughts with Seagate. They have an open issue with numbers larger than 15 digits. Seagate recommends the same work-around. Unfortunately, I can't change the datatype in the database. It affects too many other areas of the software.

Thanks to all.
 
If you are using Oracle 8 or better, then casting is an option that doesn't alter the underlying data structure.
Of course, you would have to wrap this in a view, stored procedure, or Crystal Query.

SELECT CAST (CCNumber AS VARCHAR2(20)) CCNumber
FROM YourTable;
Malcolm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top