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: Stored Procedure in Check Constraint

Re: Stored Procedure in Check Constraint

From: Todder <toddbrasseur_at_my-deja.com>
Date: Wed, 01 Sep 1999 18:46:34 GMT
Message-ID: <7qjsa6$g1$1@nnrp1.deja.com>


Thanks for the reply!!!

Using a stored procedure sure would be cleaner. Someone replied on another thread the 'maybe in a future release'.

What I have decided is to use sub-selects (when the work) and triggers when they don't.

Sub-Select:

CHECK (New.Column IN (SELECT Column FROM TABLE WHERE Type = 10 and SubType = (SELECT SubType from MASTERTABLE WHERE Column2 = :New.Column1)))

Thanks again!

Todd

In article <7qhcri$6f9$1_at_nnrp1.deja.com>,   michael_bialik_at_my-deja.com wrote:
> Hi.
>
> Sorry to disappoint you.
> The answer is NO.
> Check constraint is either a list of possible values
> ( SEX in ( 'M', 'F' ) ) or comparison of a number of columns
> in the same row ( Field1 > Field2, etc. ).
> The solution is to use triggers.
>
> Good luck. Michael.
>
> In article <7qe9ht$sgb$1_at_nnrp1.deja.com>,
> Todder <toddbrasseur_at_my-deja.com> wrote:
> > In ORACLE, does it work to do the following:
> >
> > CONSTRAINT CHECK (New.Code IN (SELECT Code FROM StoredProcedure
> > (New.CodeType)))
> >
> > That is can you have a check constraint that compares the value
> entered
> > in a column with a list which is returned by a Stored Procedure?
The
> > Stored Procedure takes the value from another column in the table
as a
> > parameter.
> >
> > Thanks in Advance
> >
> > Todd @ COMPASS
> >
> > Sent via Deja.com http://www.deja.com/
> > Share what you know. Learn what you don't.
> >
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Wed Sep 01 1999 - 13:46:34 CDT

Original text of this message

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