Would anyone please share the source for a CREATE TRIGGER statement that
checks for a change in one field and then inserts a record into a new
table? I have moved to wanting to use an SQL trigger instead of ADDPFTRG
so that I can do everything in SQL (trying to learn new stuff). I already
have a working example using ADDPFTRG and an RPGLE trigger pgm.
Thanks.
"Elvis Budimlic" <ebudimlic@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
08/23/2007 11:38 AM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
To
"'Midrange Systems Technical Discussion'" <midrange-l@xxxxxxxxxxxx>
cc
Subject
RE: Triggers
On point 3, I haven't tested it, but I see no reason why SQL trigger
wouldn't work against the PF.
Celebrating 10-Years of SQL Performance Excellence
http://centerfieldtechnology.com/training.asp
-----Original Message-----
Subject: Triggers
I have a PF where when a certain field is changed I wish to write a copy
of the record to another file. Obviously, I could do this in the RPG pgm
but prefer to not change the pgm.
I have been reading about triggers and would like some confirmation on a
couple things.
First, there are two kinds of DB triggers, PF and SQL table triggers.
Second, the PF trigger cannot detect an update to a specific field, while
the SQL trigger can execute when a change in a specific column is
detected.
Third, since my file is a PF and not an SQL table, I cannot use the SQL
trigger and must use the ADDPFTRG.
Fourth, if I were to change my PF to an SQL table, an SQL trigger would be
a good choice to address my issue.
Any other suggestions as to how to handle my situation are also welcome.
Thanks.
As an Amazon Associate we earn from qualifying purchases.