|
Greg
What are the default values for those fields? I know one can set defaults
this way -
ALTER TABLE DP2TEST/LONGNAMES ADD COLUMN NEWDATE DATE NOT NULL WITH
DEFAULT current date
ALTER TABLE DP2TEST/LONGNAMES ADD COLUMN NEWtime time NOT NULL WITH
DEFAULT current time
At least with DDL-based tables. Then an INSERT (maybe a WRITE - it's been
too long, I can't remember) like this will use date and time of when the
action took place.
INSERT INTO DP2TEST/LONGNAMES (LNAMENOBRK, LNAMEBRK, LNAMEMXD) VALUES('x',
'y', 'z')
If you can't do this for DDS files, here is something interesting from the
DDS manual -
* If you are defining a date field, specify a valid date in the same
format specified on the DATFMT keyword and use the same separator as
specified on the DATSEP keyword. For example, DFT('12/15/05') is the
default value if *MDY is specified for DATFMT and '/' is specified for
DATSEP.
If the DFT keyword is not specified, the default value is the current date.
* If you are defining a time field, specify a valid time in the same
format specified on the TIMFMT keyword and use the same separator as
specified on the TIMSEP keyword. For example, DFT('11.00.00') is the
default value if *ISO is specified for TIMFMT. The default separator for
*ISO is a period (.).
If the DFT keyword is not specified, the default value is the current time.
* If you are defining a timestamp field, you must specify the
default value in the following format:DFT('YYYY-MM-DD-HH.MM.SS.UUUUUU')
If the DFT keyword is not specified, the default value is the current time.
This looks like you should leave the DFT keyword off, then do not include
the date and time in the field list that you use when writing the record.
Maybe?
Cheers
Vern
On Thu, 10 Aug, 2023 at 1:10 PM, Mark Waterbury <
mark.s.waterbury@xxxxxxxxxxxxx> wrote:
To: midrange systems technical discussion
Greg,
A "Before Insert" Trigger should do this easily and cleanly.
HTH,
Mark
On Thursday, August 10, 2023 at 01:57:16 PM EDT, Greg Wilburn <gwilburn@xxxxxxxxxxxxxxxxxxxxxxx<mailto:gwilburn@xxxxxxxxxxxxxxxxxxxxxxx>>
wrote:
I recently added an ISO date and ISO time field to an existing database
file (DDS). This file is populated by our TrustedLink EDI software when we
receive an inbound PO. I guess I had hoped it would capture the date/time
the record was created. Tli support says the EDI translator won't update
those "automatically".
Anyone know of a method of getting these fields to update with current
info upon creation? Otherwise, I'll have to update them in my RPG
processing program.
TIA,
Greg
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx<mailto:
MIDRANGE-L@xxxxxxxxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx<mailto:
MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx<mailto:
support@xxxxxxxxxxxxxxxxxxxx> for any subscription related questions.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
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.