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 -> function in check constraint???

function in check constraint???

From: Randall J. Parr <rparr_at_temporal.com>
Date: Thu, 04 Mar 1999 11:53:12 -0600
Message-ID: <36DEC888.A2271E99@temporal.com>


Using Oracle 7.3.4 on UnixWare 7.0.1

Is it possible to use/call a function in a check constraint???

After defining the function at the bottom (which works when called from sqlplus or plsql),
given a table Person with column PersonType, none of the following will work.



alter table Person add constraint PerPersonTypeValueCheck  check ( PerValidPersonType( PersonType ) != 0 );

alter table Person add constraint PerPersonTypeValueCheck  check ( select PerValidPersonType( PersonType ) from dual );

Any suggestions as to how to achieve the equivalent in some other fashion???


 return retval;

end PerValidPersonType;
/


Thanks
R.Parr
Temporal Arts Received on Thu Mar 04 1999 - 11:53:12 CST

Original text of this message

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