add a CAPS constraint
How do I put contraints on my NAME column on EMP table so that all
the data saved are all CAPS?
Is this the correct syntax?
allter table EMP modify(NAME check upper(NAME));
allter table EMP modify(NAME default upper(trim(NAME)));
Last edited by jennifer2007; 02-19-2007 at 11:40 PM.
user a before insert trigger
The syntax you were looking for would be:
Originally Posted by jennifer2007
ALTER TABLE EMP
add CONSTRAINT constraint_name CHECK (NAME = upper(NAME));
Assistance is Futile...
readin it again, you either wan tot change the data so it is in caps or ensure the data being presented is in cap, which is it
i want to change the data in to caps...I thot i can handle it using constraint
like allowing dafault values "sysdate"....
So I really have to code a trigger? :( what if it have lots of varchar2
columns in which i wanna automate entry to caps....
if you want to change the data, then yes you need a before update trigger, you also want the constraint to ensure that it works and nothing sneaks through
If you have a frontend for insertion,better use it to enforce such a rule instead of using triggers.
There are three kinds of lies: Lies, damned lies, and benchmarks...
Unix is user friendly. It's just very particular about who it's friends are.
what happen when tables were already populated with unCAPs NAME?
Thanks hunnies How do u audit if a table with unCaps letter in it?
My front-end form data-entry is HTMLDB(APEX). Would you know how to
enforce all CAPS in the field entry?
Click Here to Expand Forum to Full Width