Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Constraint implementation question
dan.hield_at_cwcom.net wrote:
> I have an Oracle7 database on which I wish to enforce a table column to
> only contain upper case text. Can anyone tell me if this can be implemented
> declaratively or must it be done with the use of a trigger? Which ever
> the case, can you offer any suggestions that would help me do such a thing?
You have to do it via triggers. Here's an example BEFORE INSERT trigger to do
it, supposing your table is named EMP and you have character columns ENAME and
JOB.
create or replace trigger emp_enforce_case
before insert or update
on emp
for each row
begin
:new.ename := upper(:new.ename);
:new.job := upper(:new.job);
end;
/
Chris
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Dec 02 1998 - 08:11:01 CST
![]() |
![]() |