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

Home -> Community -> Usenet -> c.d.o.server -> Re: CUSTOM data integrity constraint

Re: CUSTOM data integrity constraint

From: fumi <fumi_at_tpts5.seed.net.tw>
Date: 25 Aug 1999 12:48:16 GMT
Message-ID: <7q0omg$l61$1@news.seed.net.tw>

Nandakumar <N.Kumar_at_rocketmail.com> wrote in message news:7pui04$62v$1_at_nnrp1.deja.com...
> Hi,
>
> There are two fields in a table which are of datatype varchar2.
> Say Field1, Field2.
> When Field1 is NON NULL, Field2 CAN'T be NULL.
> How could i impose this as a constraint to one of the fields?
> ...
> I think this is achievable with INSERT trigger.
> --
> Nandakumar
> (N.Kumar_at_rocketmail.com)

You can use a constraint to implement it.

alter table_name add constraint my_null_rule

    check (decode(field1, null, 1, field2) is not null); Received on Wed Aug 25 1999 - 07:48:16 CDT

Original text of this message

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