× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Simple example (untested):

CREATE TRIGGER changefield
AFTER UPDATE OF myField ON myLib/myFile
REFERENCING NEW AS NEW_ROW
FOR EACH row MODE DB2SQL
BEGIN ATOMIC
Insert into myLib/myFile2 values('new row', new_row.myField);
END

For more details, check out:
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/db2/rbafzmsthctr
igger.htm

Also, look into redbooks Birgitta mentioned.

Elvis

Celebrating 10-Years of SQL Performance Excellence
http://centerfieldtechnology.com/training.asp

-----Original Message-----
Subject: RE: Triggers - example needed

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.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.