Load Timestamp with milliseconds into Oracle

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
Dsnew
Participant
Posts: 90
Joined: Tue Apr 19, 2005 2:08 pm

Load Timestamp with milliseconds into Oracle

Post by Dsnew »

I have a simple job to read from a sequential file and load into Oracle table.
One of the column in the file in timestamp in the format.
2008-04-01 02:05:48.147
I would like to maintain the same format in the target table

If I need to load it into an Oracle table -
1. What datatype should the target column be Date or Timestamp?

2. I create the table with target column as Timestamp, but I get the below error while loading into the table
ORA-01830: date format picture ends before converting entire input string

3. I manipulated the insert statement as below and got it to load into the table.

Code: Select all

TO_timestamp(:8, 'YYYY-MM-DD HH24:MI:SS.FF3')
Is there any other way to load into the table without manipulating the insert script in the target OCI stage?

Any help appreciated.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

You are on the right method. If you define the field as timestamp in Datastage, it would certainly require this type casting before loading.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Dsnew
Participant
Posts: 90
Joined: Tue Apr 19, 2005 2:08 pm

Post by Dsnew »

Kumar, sorry for the late reponse.
Yeah I guess you are right, that may be my only option. Thanks
Post Reply