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: Matthias Gresz <GreMa_at_t-online.de>
Date: Fri, 05 Mar 1999 08:08:15 +0100
Message-ID: <36DF82DF.EA508EF4@t-online.de>

Mark Gumbs schrieb:
>
> We have a table with a date range on it i.e. start and end dates. We want
> to make sure that for any particular person (EMPNO???) that the date ranges
> entered do not overlap those of any existing records.
>
> How best to implement this?
>
> We thought
>
> a) constraint, but you can't put SQL in it.
> b) database trigger. This would give us a mutating table though, we
> suspect as we need to query the table being inserted (or updated) into.

Not necessarily:

SELECT
        field
FROM
        TABLE t
WHERE
        t.rowid != :new.rowid
;

may do well.

> c) application (Forms) code. This will work but we'd like the extra
> safety net of testing at the server level also.
>

HTH
Matthias
--
grema_at_t-online.de

Protect privacy, boycott Intel: http://www.bigbrotherinside.org Received on Fri Mar 05 1999 - 01:08:15 CST

Original text of this message

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