Inserting a TimeStamp Value into Oracle Database

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
vivek_rs
Participant
Posts: 37
Joined: Thu Nov 25, 2004 8:44 pm
Location: Bangalore, Karnataka, India

Inserting a TimeStamp Value into Oracle Database

Post by vivek_rs »

Hi
I am unable to insert a Timestamp DataType value into and Oracle 9i database. I'm using an ODBC Stage with User Defined SQL as the Update Action.

Code: Select all

lookup..Transformer_11.DSLink13: DSD.BCIPut call to SQLExecute failed.
SQL statement:INSERT INTO COMET_ETL.CHECKDATETIME(ID, CITY, CURRENTDATE) VALUES (?,?,TO_DATE(?, 'MM-DD-YYYY HH24:MI:SS')) 
SQLSTATE=22008, DBMS.CODE=0
[DataStage][SQL Client][ODBC][DataDirect][ODBC Oracle Wire Protocol driver]Datetime field overflow.  Error in parameter 3.

ID = "1"
CITY = "2"
CURRENTDATE = "12-09-2004 17:51:29"
Please help
TIA
Regards,
Vivek RS
bakul
Participant
Posts: 60
Joined: Wed Nov 10, 2004 2:12 am

Post by bakul »

Instead of using TO_DATE(?, 'MM-DD-YYYY HH24:MI:SS') in the user-defined query,you could generate the timestamp in the transformer using,
OConv(@DATE,"D-YMD[4,2,2]"):'-':Oconv(@TIME,"MTS."):'.':'000000'

Define the timestamp field as timestamp with length of 26 and scale 6
Now directly use this timestamp in the insert query.
Regards,
Bakul
vivek_rs
Participant
Posts: 37
Joined: Thu Nov 25, 2004 8:44 pm
Location: Bangalore, Karnataka, India

Post by vivek_rs »

That helped a lot Bakul
Thanks a lot!
Regards,
Vivek RS
changming
Participant
Posts: 68
Joined: Wed Oct 13, 2004 3:35 am

date format

Post by changming »

the datastage can not recognise the date foramt(dd/mm/yyyy)
use oconv and iconv to format the date to yyyy-mm-dd then you can load date. the delimeter symbol is not important.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DataStage can "recognize" any date format, because it does not have any data types - everything is a character string.

It's the database servers and/or their client software (such as ODBC drivers) that grumble about date formats - not DataStage!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply