Hi all,
I am loading a seq file to a DB2 db.
I have a date field column in the table
when i try to load the value in this column "cannot able to convert sting to date" warning is coming.
I have been using the below function but of no use
OConv(IConv(FM_FLEETS_HASH_FILE.START_DT,"D"),"D-YMD[4,2,2]")
Please help me in this regard.
Thanks,
converting string to date for DB2
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The error arises from the Iconv() function. Whatever the format of your date is, it is not understood by "D" as a conversion, which expects the date format of your locale (had you provided your location I could probably be more specific about that). Try if your date is in year - month - day order.
I agree with Craig that you probably don't need the Oconv() function when sending dates to DB2.
Code: Select all
Iconv(FM_FLEETS_HASH_FILE.START_DT,"DYMD")
I agree with Craig that you probably don't need the Oconv() function when sending dates to DB2.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.