Error while trying to load timestamp data 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
ds_ram
Participant
Posts: 30
Joined: Fri Apr 06, 2007 6:04 am
Location: Bangalore

Error while trying to load timestamp data into oracle

Post by ds_ram »

Hi,
I have a flat file input with a datetime column. The input data will have the format mm/dd/yyyy hh:mm:ss. The target is oracle database. When I tried to load data, I am getting the error Datetime field overflow. I have chosen timestamp as the datatype in DataStage and date in the target Odbc stage. It is a direct load. Please let us know how to populate timestamp value in Oracle.
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

which ora-Stage do you use (OCI or Bulk)?
Wolfgang Hürter
Amsterdam
vijaydev
Participant
Posts: 54
Joined: Sun May 20, 2007 6:31 pm

Post by vijaydev »

first load it to sequencial file and then load it to oracle it will work
Vijay
rverharen
Premium Member
Premium Member
Posts: 34
Joined: Fri Jan 19, 2007 9:09 am
Location: Breda, The Netherlands

No formats needed when using the default

Post by rverharen »

if you are able to define the format of the field in the flat file,
use YYYY-MM-DD HH:MM:SS
this is the format that datastage automtically recognizes for timestamp fiels.
The field in the oracle database can be date (which also accepts time-indications). You don't have to specify any formats using these settings.
vijaydev
Participant
Posts: 54
Joined: Sun May 20, 2007 6:31 pm

Post by vijaydev »

in built routines are there to convert and to load oracle check path routines--sdk--date
Vijay
vijaydev
Participant
Posts: 54
Joined: Sun May 20, 2007 6:31 pm

Post by vijaydev »

use this i got same problem

routinename='rtDateTimeStamToOraOCIWithTime'

If Arg1 Then
Ans=Arg1[1,19]
end else
Ans=Arg1
End

use this in one routine and pass the time stap to the target
it will work
Vijay
ds_ram
Participant
Posts: 30
Joined: Fri Apr 06, 2007 6:04 am
Location: Bangalore

Post by ds_ram »

Already it is in a sequential file. Even if I give mm/dd/yyyy without timestamp, it gives me overflow error. I am using ODBC for ORACLE.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What is the ORA code that you are getting? Also tell us, what is the length and scale that you are using for this particular field.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
jreddy
Premium Member
Premium Member
Posts: 202
Joined: Tue Feb 03, 2004 5:09 pm

Post by jreddy »

You can use DateTimeStampToOraOCIWithTime(DateGenericToTimeStamp(link.inputcolumnname)) in the derivation - it should insert the right timestamp in the oracle target column.. This works for me
Post Reply