Page 1 of 1

DB2 Insert Date and Timestamp

Posted: Fri Mar 14, 2003 2:11 pm
by MAT
Hi,
I need to load seq files in DB2 tables. My inserts work well except when i have Date and Timestamp formats. I receive a SQL error, saying it does not recognize the datetime format. It is surprising because I do not have trouble loading these formats normally. Do I need a special formatting for DataStage to recognize a Date and a Timestamp?

My formatting:
Date : yyyy-mm-dd
Timestamp : yyyy-mm-dd.hh.mm.ss.nnnnnn

Thanks

MAT

Posted: Fri Mar 14, 2003 3:45 pm
by chulett
The documentation for the plugin stage you are using to write to the DB2 database should specify the Timestamp format it is expecting. For example, OCI wants "YYYY-MM-DD HH24:MI:SS".

-craig

Posted: Fri Mar 14, 2003 8:24 pm
by dickfong
A little sharing.

Try to format your date with IConv(your_date_data, "YMD[4,2,2]") before loading to DB2. It works for us.

For the timesstamp, our format for successful loading is
yyyy-mm-dd hh:mm:dd.nn
you may want to try it as well.

Hope that helps

Dick

Posted: Mon Mar 17, 2003 8:45 am
by MAT
thanks guys. It worked.

MAT

Posted: Thu Mar 27, 2003 5:14 pm
by jseclen
Hi MAT

I work with DB2/390 and the timestamp format is

yyyy-mm-dd-hh.mm.ss.nnnnnn
2003-03-07-19.14.04.002959

[:D][;)]

Saludos



Miguel Seclen
Lima - Peru