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


  • Subject: Re: Using a trigger to restrict access to costing bill
  • From: "R. Bruce Hoffman, Jr." <rbruceh@xxxxxxxxxxxxx>
  • Date: Fri, 30 Mar 2001 13:50:44 -0500

-----Original Message-----
From: Bazinet, Bill <bazinew@leanintree.com>
To: 'rpg400-l@midrange.com' <rpg400-l@midrange.com>
Date: Friday, March 30, 2001 1:15 PM
Subject: RE: Using a trigger to restrict access to costing bill


>
>
>The difficulty with this approach is that the trigger must be a *BEFORE
>or*AFTER timing.  If it's before you can definitely determine that the
>insert/update/delete shouldn't occur but I don't see how you can prevent
it.
>Remember the trigger gets copies of the output buffer from the program
>causing the trigger to fire.  If you use a *BEFORE trigger, upon return to
>the I/O processor the original action will occur.  If you use an *AFTER
>trigger, the operative work is "AFTER".
>Using an *AFTER trigger, you could go back and reset the orignal state of
>the record because the trigger does contain the before picture of the
>record.


The way to prevent the update is to use the before trigger with allow
repeated change *YES and in the program, replace the new record buffer
contents with the old record buffer contents, thus nullifying the update.


===========================================================
R. Bruce Hoffman, Jr.
 -- IBM Certified Specialist - AS/400 Administrator
 -- IBM Certified Specialist - RPG IV Developer

"America is the land that fought for freedom and then
  began passing laws to get rid of it."

     - Alfred E. Neuman



+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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.