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: SQL in constraints II

Re: SQL in constraints II

From: keith boulton <boulke_at_globalnet.co.uk>
Date: Sat, 06 Mar 1999 17:01:46 GMT
Message-ID: <36e1527d.12253269@read.news.global.net.uk>


On Fri, 05 Mar 1999 08:08:15 +0100, GreMa_at_t-online.de (Matthias Gresz) wrote:

>Not necessarily:
>
>SELECT
> field
>FROM
> TABLE t
>WHERE
> t.rowid != :new.rowid
>;
>
>may do well.
>

I just tried this, and it seems only to work in an insert statement. In an update statement, you still get a mutating table error.

You, of course, know that this constraint can be implemented by:

  1. create a package to hold a pl/sql table of empnos
  2. Use a statement level pre-update/insert trigger to ensure that the pl/sql table of empno's is empty.
  3. Use a row-level post-update trigger to populate the table with the empno's being modified
  4. Use a statement level post-update trigger to iterate through the pl/sql table, checking for overlapping date ranges.
Received on Sat Mar 06 1999 - 11:01:46 CST

Original text of this message

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