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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check constraint with input mask

Status
Not open for further replies.

dafreki

Programmer
Sep 12, 2002
3
CA
I'm having an impossible time figuring out how to do a check constraint with an input mask. The user has to input a code in the format AAA9, A being any letter and 9 being any number.
I can't get past Check(UserCode LIKE ........
Is there anything in oracle that's equivalent to [A-Z] and [0-9]? If anyone could help, it would be greatly appreciated.

 
Hi.
A possible workaround would be the TRANSLATE-function:
CHECK( TRANSLATE( UserCode,'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'9999999999AAAAAAAAAAAAAAAAAAAAAAAAAA') ='AAA9')

Stefan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top