Formatting a Date to write to a sequential file
Posted: Wed Apr 25, 2007 2:38 pm
I am attempting to write a date, as well as other information, from an Oracle table to a seq file.
The field is defined as DATE in the Oracle table and VARCHAR(10) on the seq file. Without any date functions, etc., the date written to the file is the internal date, for example, 17995. When I use the DATE.TAG function, I get "2017-04-07", instead of "2007-04-17". I am inserting the date into the BATCH table by using "to_date('#parmDATECARDDT#', 'YYYY-MM-DD).
INSERT INTO BATCH(batch_oid, batch_dte, input_src, input_batch_type)
VALUES (9998, TO_DATE('#parmDATECARDDT#', 'YYYY-MM-DD'),
'#parmInputSource#','Q')
I can select the field from teh database using:
to_char(batch_dte, 'YYYY-MM-DD'),
Any help would be appreciated.
The field is defined as DATE in the Oracle table and VARCHAR(10) on the seq file. Without any date functions, etc., the date written to the file is the internal date, for example, 17995. When I use the DATE.TAG function, I get "2017-04-07", instead of "2007-04-17". I am inserting the date into the BATCH table by using "to_date('#parmDATECARDDT#', 'YYYY-MM-DD).
INSERT INTO BATCH(batch_oid, batch_dte, input_src, input_batch_type)
VALUES (9998, TO_DATE('#parmDATECARDDT#', 'YYYY-MM-DD'),
'#parmInputSource#','Q')
I can select the field from teh database using:
to_char(batch_dte, 'YYYY-MM-DD'),
Any help would be appreciated.