Re: TRICKY TRIGGER QUESTION

From: Joel Friedman <joelf_at_volpesys.com>
Date: 1997/08/06
Message-ID: <33E91D83.14B7_at_volpesys.com>#1/1


sprajapa_at_fmrco.com wrote:
>
> Using update trigger, is there any way to capture primary key updates
> into a separate table ? I want to capture all primary key updates in
> a table given as:
>
> log_table
> (table_name char(30),
> old_key_val char(255),
> new_key_val char(255)
> )
>
> There may be one or more rows updated in a "single trigger execution
> cycle".
> OBVIOUSLY, Primary key column(s) are updated either for all rows or for
> none within THAT trigger execution.
>
> Thanks in advance.
>
> regards,
> Sunil Prajapati
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet

Why not just use the updated() function to determine if a member of the primary key was updated. Grab the new value from inserted and the old value from deleted.

Joel.

-- 
>>>------------------------------<<<
   Joel Friedman (C/S Consultant)
   joelf_at_volpesys.com
>>>------------------------------<<<
Received on Wed Aug 06 1997 - 00:00:00 CEST

Original text of this message