× 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.



a.. Subject: Re: Prevent a record from being written using a trigger program.
b.. From: Booth Martin <booth@xxxxxxxxxxxx>
c.. Date: Fri, 02 Sep 2011 13:43:43 -0500
d.. List-archive: <http://archive.midrange.com/rpg400-l>
e.. List-help: <mailto:rpg400-l-request@xxxxxxxxxxxx?subject=help>
f.. List-id: RPG programming on the IBM i / System i <rpg400-l.midrange.com>
g.. List-post: <mailto:rpg400-l@xxxxxxxxxxxx>
h.. List-subscribe: <http://lists.midrange.com/mailman/listinfo/rpg400-l>, <mailto:rpg400-l-request@xxxxxxxxxxxx?subject=subscribe>
i.. List-unsubscribe: <http://lists.midrange.com/mailman/listinfo/rpg400-l>, <mailto:rpg400-l-request@xxxxxxxxxxxx?subject=unsubscribe>


--------------------------------------------------------------------------------
I have no desire to beat on a dead horse, but if you are going to be sending messages anyway, why not just pop-up a window saying "The new customer number is: "12345" " when they click the add button. The new customer number is assigned quickly by the trigger program, so no user delay will be experienced.

(My fear is that if your trigger chases down all the child files that can be affected today, that design would fail tomorrow when the gunslinger from out of town adds a new child file and doesn't know he is supposed to tell you about it.)

*****

sending an escape message up the call stack is very diffrent to sending a message to a user!
If you send an escape message from a before trigger, the write will fail and the programm, which caused the trigger to fire will have an error situation (using SQL a negative SqlCode, using RLA the error indicator of the write operation, if there is one coded, wil be set on). In this case the record will not be written/updated to the database.
That's very diffrent from deleting the record in an after trigger!!! preventing the update in a before trigger, the programm trying it, will get knowledge. Deleting the record in an after trigger for the originating programm it looks like all did work; I would strongly recommend not to use an after trigger to delete records!

D*B



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.