Re: Dynamic trigger values
Date: 14 Jan 2003 09:38:20 -0800
Message-ID: <45a06b65.0301140938.a4f2c9b_at_posting.google.com>
"Jim Kennedy" <kennedy-family_at_attbi.com> wrote in message news:<pVLU9.672957$%m4.3384528_at_rwcrnsc52.ops.asp.att.net>...
> This is going to be real slow if you actually accomplish it. Just write a
> script to write a script to generate the triggers for the tables.
> Jim
> "FedStruggle" <radha_a_at_hotmail.com> wrote in message
> news:f757a807.0301131017.3d33b8b8_at_posting.google.com...
> > Hello
> > I am trying to write a trigger which would get the column names from
> > the "user_tab_columns" table and loop through the columns to compare
> > the old and new values. The problem is to get these values. How can I
> > do :old.column_name where the column name will be stored in a variable
> > ?
> >
> > The idea of doing this trigger is to create a history of changes made
> > to a particular record in a table. There are about 100 tables for
> > which we need this information. And so we are trying to make the code
> > common.
> > Thanks a lot.
Jim's suggestion is the right way to go.
Look at the archives here for an example (link may wrap)
http://groups.google.com/groups?&selm=Xns9262EEC77B922pobox002bebubcom%4063.240.76.16
I'm also not certain why you would loop through the columns in a trigger to see if the data had changed, especially in generic trigger code where the columns involved are meaningless. It would be less stressful for the end users if you just archived the rows regardless and then removed any dupes in batch at the end of the day if really needed.
Martin Received on Tue Jan 14 2003 - 18:38:20 CET