Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Question: CHECK constraint or trigger?
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.comReceived on Wed Mar 04 1998 - 00:00:00 CST