I'm writing a trigger pgm and using SQL to insert/update/delete data in another file.
I'm inserting a new row into a table containing several date fields... the date field (rec.DEL_DATE) in my ILE RPG program contains '0001-01-01' according to debug. I do not have a value for that date field yet - a user will enter it via another application.
I'm gettting the error below. The DB file is defined using DDS, and date fields are data type "L".
Additional Message Information
Message ID . . . . . . : RNX0114 Severity . . . . . . . : 99
Message type . . . . . : Escape
Date sent . . . . . . : 03/03/16 Time sent . . . . . . : 17:01:23
Message . . . . : The year portion of a Date or Timestamp value is not in
the correct range.
Cause . . . . . : A conversion was requested to a Date value, from a
Timestamp or a Date value, and the year of the source Timestamp or Date is
not in the allowable range of the target.
-- The range for a 2-digit year is 1940-2039.
-- The range for a 3-digit year is 1900-2899.
-- The range for a 4-digit year is 0001-9999.
Here is my statement:
I'm inserting a new row into a table containing several date fields... the date field (rec.DEL_DATE) in my ILE RPG program contains '0001-01-01' according to debug. I do not have a value for that date field yet - a user will enter it via another application.
I'm gettting the error below. The DB file is defined using DDS, and date fields are data type "L".
Additional Message Information
Message ID . . . . . . : RNX0114 Severity . . . . . . . : 99
Message type . . . . . : Escape
Date sent . . . . . . : 03/03/16 Time sent . . . . . . : 17:01:23
Message . . . . : The year portion of a Date or Timestamp value is not in
the correct range.
Cause . . . . . : A conversion was requested to a Date value, from a
Timestamp or a Date value, and the year of the source Timestamp or Date is
not in the allowable range of the target.
-- The range for a 2-digit year is 1940-2039.
-- The range for a 3-digit year is 1900-2899.
-- The range for a 4-digit year is 0001-9999.
Here is my statement:
PHP Code:
exec sql insert into ASTHHOBJ.OECMPLNCE
(COM_NBR, WHS_NBR, ORD_NBR, REL_NBR,
ENT_NBR, ENT_NAME, PO_NBR, PROD_AMT,
REQ_DATE, SHP_DATE, CAN_DATE, DEL_DATE,
SBM_DATE, PROD_RDY, RDY_DATE, RTE_DATE,
SHIP_VIA, SCAC, CARRIER, RTNG_ID, NOTES,
LINES, QTY, CTNS, CTN_LBLS, PROD_LBLS,
JOB_CAT, JOB_DESC, EST_TIME, CSR_TIME,
FRK_TIME, WHS_TIME)
values(:rec.COM_NBR, :rec.WHS_NBR, :rec.ORD_NBR,
:rec.REL_NBR, :rec.ENT_NBR, :rec.ENT_NAME,
:rec.PO_NBR, :rec.PROD_AMT, :rec.REQ_DATE,
:rec.SHP_DATE, :rec.CAN_DATE, :rec.DEL_DATE,
:rec.SBM_DATE, :rec.PROD_RDY, :rec.RDY_DATE,
:rec.RTE_DATE, :rec.SHIP_VIA, :rec.SCAC,
:rec.CARRIER, :rec.RTNG_ID, :rec.NOTES,
:rec.LINES, :rec.QTY, :rec.CTNS,
:rec.CTN_LBLS, :rec.PROD_LBLS, :rec.JOB_CAT,
:rec.JOB_DESC, :rec.EST_TIME, :rec.CSR_TIME,
:rec.FRK_TIME, :rec.WHS_TIME);






.
Comment