Re: PL SQL - Trigger. How to get the column names of SQL that fired the trigger

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 31 Jul 2001 21:08:33 +0200
Message-ID: <996606516.12818.0.pluto.d4ee154e_at_news.demon.nl>


"PK R" <pk_ramesh_at_hotmail.com> wrote in message news:1d24bf37.0107310604.64365bb1_at_posting.google.com...
> Hi All,
>
> Inside the Oracle UPDATE trigger, I need to have code only if the
> UPDATE has one specific column.
> Eg :
> Table : table_1
> Columns : C1,C2,C3,C4,C5
> Requirement: To write an update trigger only for the SQL:
> update table_1 set C3 = <some value>;
> AND NOT for all updates for that table.
>
> I know to write UPDATE trigger for table table_1. But how to make it
> specific such that the trigger will be activated (or a method to find
> within the trigger that the responsible update involves ONLY the
> specific column) only if the specific column alone is used in the
> triggering SQL.
>
> Any help is appreciated.
>
> Thanks.
> pk_ramesh_at_hotmail.com

if updating('c3') then
... whatever you want to do
end if;

You could of course also define the trigger as before update of c3 and it will fire only when you update c3. Issues like this are described in the Oracle Application Developers Guide.

Hth,

Sybrand Bakker, Senior Oracle DBA Received on Tue Jul 31 2001 - 21:08:33 CEST

Original text of this message