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: Update triggers - can you detect columns not being updated?

Re: Update triggers - can you detect columns not being updated?

From: Jurgen van Dongen <jovado_at_worldaccess.nl>
Date: 1997/01/05
Message-ID: <N.010597.130946.14@ldn6-13.worldaccess.nl>#1/1

On 02-01-97 6:44, in message <5ags6e$4gu_at_news.mr.net>, John Mara <john.mara_at_conncomp.com> wrote:

> Greetings, salutations and Happy New Year! I have a question for those of you
> versed in Oracle update triggers. We are building an application that
> maintains tables, with each table containing two audit columns. One column
> contains a user id of who updated it last, another contains the date and time
> of the update.
>
> We would like the application to supply these values, and have the trigger
> supply them if the tables are updated outside of the application. To do that,
> we need to detect if these two columns are included within an update
> statement.
> Therein lies the problem. With an update statement, any columns that are not
> supplied in remain unchanged. We haven't found a way to detect if the columns
> are used?
>
> Any suggestions? Thanks!
>

John,

If I have understood your problem well, than it doesn't matter even the row is updated by the application or outside of the application.

We have by all tables audit columns and have the following update trigger on it.

:new.<col_user> := user;
:new.<col_date> := sysdate;

On this behaviour you can always see who has and when updated the table.

regards,

Jurgen van Dongen


Client/Vision BV                    Tel: +31(0)23-5627221
Hoofdweg 678                        Fax: +31(0)23-5657748
2132 BT Hoofddorp           E-mail: Jovado_at_worldaccess.nl
The Netherlands
Received on Sun Jan 05 1997 - 00:00:00 CST

Original text of this message

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