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 Question: CHECK constraint or trigger?

Re: SQL Question: CHECK constraint or trigger?

From: Andrew Barnett <nobody_at_nospam.bp.com>
Date: 1998/03/04
Message-ID: <01bd4724$2ba26660$4a0564a1@azmelw1358.mel.az.bp.com>#1/1

you can use a before-every-row trigger to cache the updated/inserted nameids in a package pl/sql table, and then use an after-statement trigger to ensure that only one is current. mail me for an example.

still, never sure about this sort of table design. perhaps would be better to have a table name_current_address, with 1 row per nameid, and foreign key refs to name and address tables. alternatively, you could have an current_addressid foreign key in the name table, but I'm equally unsure about the advisability of this kind of circular relationship.

-- 
Andrew - Wizzard

barnetaj_at_bp.com
Received on Wed Mar 04 1998 - 00:00:00 CST

Original text of this message

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