Re: Help for an Oracle Newbie

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Mon, 25 Aug 2008 07:37:56 +0200
Message-ID: <48b2453a$0$199$e4fe514c@news.xs4all.nl>

"DA Morgan" <damorgan_at_psoug.org> schreef in bericht news:1219609246.570456_at_bubbleator.drizzle.com...
> Shakespeare wrote:
>
>>> If it is NOT NULL then it will not be equal to the previous value.
>>
>> O yes it can be, if a user selects a record and updates some columns
>> except lastupdated. (E.g. using Oracle Forms: query a record, update and
>> commit.)
>> In that case lastmodified will not be updated, where the record was
>> changed!
>
> An AFTER UPDATE trigger without an OF clause will fire no matter what is
> or is not updated.
> --
> Daniel A. Morgan
> Oracle Ace Director & Instructor
> University of Washington
> damorgan_at_x.washington.edu (replace x with u to respond)
> Puget Sound Oracle Users Group
> www.psoug.org

That is correct, but this one is not:

> If it is NOT NULL then it will not be equal to the previous value.

An application like Oracle Forms can send all columns to the update statement, even if there not updated (I think to remember you have to set a preference like UPDATE_CHANGED_COLUMNS to avoid this). But your trigger will fire in that case, so it's not a real issue.

The problem is in when the lastupdated column is changed by hand (suppose someone puts in a Forms trigger as well, setting lastupdated to some incorrect value). Your trigger will fire, but won't change the lastupdated column to the correct value.

Shakespeare Received on Mon Aug 25 2008 - 00:37:56 CDT

Original text of this message