DB2 Insert Date and Timestamp

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
MAT
Participant
Posts: 65
Joined: Wed Mar 05, 2003 8:44 am
Location: Montréal, Canada

DB2 Insert Date and Timestamp

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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
dickfong
Participant
Posts: 68
Joined: Tue Apr 15, 2003 9:20 am

Post 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
MAT
Participant
Posts: 65
Joined: Wed Mar 05, 2003 8:44 am
Location: Montréal, Canada

Post by MAT »

thanks guys. It worked.

MAT
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Post 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
Post Reply