• Subject: Re: Data base triggers
  • From: dhandy@xxxxxxxxxxx (Douglas Handy)
  • Date: Tue, 25 Jan 2000 12:58:54 -0500

Booth,

>And why not just 
>always set the parm at *YES?  What is the downside?  What protection or 
>efficiency does it provide?

I think the main protection is against inadvertent changes to the
buffer.  ALWREPCHG() wasn't added until V3R2 and V3R7, so the
(shipped) default has to be *NO to remain backward compatible.

This is not unlike the situation when you change a RPG program file
from input only to update and rewrite the entire record format with
UPDATE.  If (for whatever reason) a previous programmer had mucked up
some fields instead of using separate stand-alone variables, the
database gets updated.

Having a default of *NO ensures backward compatibility.  The
efficiency is probably a minor non-issue, since it would presumably
deal with the buffer as a whole upon return from the trigger program.

The addition of ALWREPCHG(*YES) is great, especially for things like
setting last change user/timestamp stuff or some dynamic defaults.  A
number of people also used (use?) it for Y2K database changes to sync
dates between a 6-digit date field and a 8-digit date or date data
type field.  The trigger just detects which changed and syncs the
other field to match.

Doug
+---
| 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 ...

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.