AS400 Triggers
750 pts.
0
Q:
AS400 Triggers
Hi,

I want to write a Trigger for a file. I want to test if the trigger can be fired only when the file operation is comitted in the program.

can you explain me this trigger concept in scenario such that......i update a file. This file has trigger associated with it. now suppose the program fails after i update the file and before program executes 'Comit' operation.....In such case I dun want the trigger to be fired as my operation is not comitted......Is there any work around for such scenario....

Can i write a simple routines to test my programs for such scenarios...

Thanks,

Nutan.



Software/Hardware used:
AS400
ASKED: Aug 31 2009  9:22 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
24610 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
recent discussion
http://itknowledgeexchange.techtarget.com/itanswers/trigger-program-written-in-rpgle/

-------------
09/01/09
Didn't read your question closely enough.
You trigger on add/update/delete not commit.
The add/update/delete makes the file changes but keeps the records locked
The Commit releases the locks and moves the boundry in the journal but doesn't fire a trigger.
On the other hand, you could call a program at the point of the commit.

Phil

The journal will recieve each file update and if a rollback occurs the journal will recieve the roll back for each file that was changed. The journal has integrity.

Apparently your trigger is writting to a log file, you may want to write to the log file also when you commit or rollback but you cann't do these with a trigger.
Last Answered: Sep 1 2009  1:28 PM GMT by Philpl1jb   24610 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Nutangujar   750 pts.  |   Aug 31 2009  9:46PM GMT

thanks Phil. I’m still confused with the concept of Comit operation on database….
I think there is no way I can make ‘Comit’ operation as the trigger event. If I’m not wrong then this is the limitation of AS400 Trigger ….This may mar integrity between the trigger log file and actual database update that has taken place….and there is no way to overcome this…

Please correct if I’m wrong..

Nutan.

 
0