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 -> INSTEAD OF UPDATE triggers (Oracle8)

INSTEAD OF UPDATE triggers (Oracle8)

From: Andy Marden <amarden_at_altavista.net>
Date: Thu, 02 Sep 1999 09:33:02 +0100
Message-ID: <37CE363E.BBABAC82@altavista.net>


I'm creating an INSTEAD OF UPDATE trigger on a view in Oracle8. Essentially the view is a UNION ALL of two tables, and the trigger is able to check the primary key of what's being updated and update the correct underlying table.

To accomplish this, I've needed to specify the primary key columns in the update statement itself (so the trigger has something to check the underlying tables with).

The trigger is written to be nice and generic so that any number columns can be updated through the view. The trouble is when columns are updated to NULL. The :old values are always NULL in this type of trigger, and the :new values for columns that are not specified in the update statement are also NULL. This means that there seems to be no way that the trigger can tell if a column is mentioned in the update statement and set to NULL, or if the column is not being updated.

What's really needed is a way of retrieving the list of columns being updated once in the trigger. Guess it's a little gap in functionality (not to mention the old NULL-being-used-for-more-that-one-logical-thing chestnut).

Does anyone know a clean workaround for this?

Cheers

Andy Received on Thu Sep 02 1999 - 03:33:02 CDT

Original text of this message

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