Q
Problem solve Get help with specific problems with your technologies, process and projects.

Example code to update trigger on RPG

I need an example code to update trigger on RPG. I need to know how to cancel the event (insert, update or delete) if an evaluation condition fail. How can I alter the member in the physical file using the SQL without OVRDBF command?

I don't have and example of an update trigger in RPG, although the insert example does contain updates. It can be found here.

The only way I know to cancel the event if an evaluation condition fails is to use commitment control in the calling process and force an error in the trigger program if the conditions fail. This will force a roll back and affect the desired result. Within SQL you can call a custom CL that does the override based on your passed parameters.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.


Dig Deeper on RPG iSeries programming

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close