Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Constraint implementation question

Re: Constraint implementation question

From: Daniel Clamage <dclamageNOSPAM_at_telerama.com>
Date: Wed, 2 Dec 1998 23:33:28 -0000
Message-ID: <36661637.0@paperboy.telerama.com>


You use a check constraint, which converts the column text to upper case. This is straight out of the Developer's Guide.

--
- Dan Clamage
http://www.telerama.com/~dclamage
If you haven't crashed the Server,
you haven't been trying hard enough.
toneczar_at_erols.com wrote in message <743hpj$kr2$1_at_nnrp1.dejanews.com>...
>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
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Chris Hamilton -- toneczar_at_erols.com
>http://www.serve.com/cowpb/chamilton.html
>AVANCO International, Inc.
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Wed Dec 02 1998 - 17:33:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US