Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Creating Contraint using sql
You cannot define check constraints that reference columns in other tables. You can, however, write a database trigger (on insert, update) that calls a PL/SQL stored procedure that performs the test and returns the success of the test. If the test fails, you can rollback the insert/update.
Cuong Quyen Truong <jackt_at_cse.unsw.EDU.AU> wrote in article
<Pine.OSF.3.95.970918191250.21462B-100000_at_pipe07.orchestra.cse.unsw.EDU.AU>.
.
>
> Does anyone know how to make constraint between relations. For example
> Relation A has attributes a1(NUMBER) a2(NUMBER) and Relation B has
> attribures b1(NUMBER) b2(NUMBER) then I would like to make a contraint
> which say that if a1=b1 then a2 must be > b2.
Received on Fri Sep 19 1997 - 00:00:00 CDT
![]() |
![]() |