VARCHAR contains only characters: how to do ?
Hello people,
I declared a field in my table : my_field VARCHAR(20), but I don't want it to contain any number: can you tell me how I can do that using a trigger or using a constraint ?
Thank you in advance for any help
Related Article: Data type time in oracle sql
is a Oracle discussion thread by rugged1529 that has 2 replies, was last updated 1 year ago and has been tagged with the keywords: create, datatype, oracle, sql, table, time.
begueradj
Junior Poster in Training
70 posts since Mar 2007
Reputation Points: 9
Solved Threads: 0
Skill Endorsements: 0
The easiest way is to control this by the application that will be inserting and/or updating the column.
ie. Oracle Forms???
A more difficult way (but not too difficult) is to use a Before Insert trigger.
Loop through your digits (0..9)
and do an InStr() on your input string, checking for your digits.
Fail the trigger if you find any numbers.
Thank you very much for your help, I used the trigger as you advised me
begueradj
Junior Poster in Training
70 posts since Mar 2007
Reputation Points: 9
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 1 Year Ago by
hfx642