Billy Ma
asked on
Credit Card Number Validation in PL/SQL
I want to write a function to validation credit card number,
I found a code there
http://www.notesbit.com/index.php/scripts-oracle/validate-the-credit-card-plsql-code/
but I am not sure whether it is good or not.
Anyone can tell?
I found a code there
http://www.notesbit.com/index.php/scripts-oracle/validate-the-credit-card-plsql-code/
but I am not sure whether it is good or not.
Anyone can tell?
ASKER
So the logic is right, :) I am going to use it
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i would say the below bit is not exactly correct. VISA card also has 16 digits right ?
.....
IF creditcardlength = 13
THEN
IF c1 IN (4)
THEN
cardtype := ‘VISA’;
......
Also if at all there is some special "," character in the card number, then we might have to put in the below extra line as well...
....
creditcardnumber := REPLACE(creditcardnumber, '_', '');
....
I would say you test that code what all kinds of credit cards data you have in your uat /test database/environment and then take a decision accordingly after validating the test results.
Thanks
.....
IF creditcardlength = 13
THEN
IF c1 IN (4)
THEN
cardtype := ‘VISA’;
......
Also if at all there is some special "," character in the card number, then we might have to put in the below extra line as well...
....
creditcardnumber := REPLACE(creditcardnumber, '_', '');
....
I would say you test that code what all kinds of credit cards data you have in your uat /test database/environment and then take a decision accordingly after validating the test results.
Thanks
ASKER
hi nav_kum_v,
We did handle 16 digit visa card.
thanks
We did handle 16 digit visa card.
thanks
not exactly how I would have written it ... but appears to follow the right rules and do the right job.
lwadwell