|
This explanation makes sense; unfortunately, the documentation doesn't. You don't want the system "helping" you by automatically posting values to fields you want to keep "empty" (like timestamp indicating a "last use"). A before trigger is an excellent suggestion but my requirement is simple; adding another line of code to the program is the best solution (it provides the desired result with minimal code and no confusion). Doug, thanks... -reeve -----Original Message----- From: midrange-l-bounces@midrange.com [mailto:midrange-l-bounces@midrange.com] On Behalf Of Douglas Handy Sent: Monday, January 13, 2003 10:43 PM To: Midrange Systems Technical Discussion Subject: Re: Initializing a timestamp field when adding a record Reeve, >Am I mis-reading or was it mis-written? I'm mis-tified. I believe the DFT() value, or in your case, the implied default of the current time, is only applied when using a record format excluding the field. Thus when you used a LF without the timestamp field, the PF received the current time. Similarly, if you used a SQL INSERT without naming the field, it would also receive the current time. In your second DFU (the one without the timestamp field), did you use the PF record format name? If so, that would explain the behavior. In that case you in essence named the field by virtue of it being in the format, and thus are responsible for populating the field. In RPG if you name the PF format you have the same situation -- the default does not apply anymore. If you don't want to use a LF which excludes the timestamp field, another option would be to create a *Before trigger which allows repeating changes, and modify the record buffer to include the current time (and possibly user ID, etc). Doug _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo.cgi/midrange-l or email: MIDRANGE-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.