loading Timestamp into Oracle

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
phanikumar
Participant
Posts: 60
Joined: Tue Sep 20, 2011 10:44 pm
Location: INDIA

loading Timestamp into Oracle

Post by phanikumar »

Hi All,

Inserting timestamp value into Oracle in 8.5 and 9.1.

In 8.5 I am able to see the right value

25/FEB/14 09:02:18.000000000 PM

In 9.1 the time stamp is being defaulted to

25/FEB/14 12:00:00.000000000 AM

I tried to run with the same data and same code in both environments and they both loading same table one after the other in same environment.

Data looks good in both cases except for timestamp.

Any ideas.

Regards
Kumar
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Try setting Extended to Microseconds for Timestamp colum
You are the creator of your destiny - Swami Vivekananda
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It looks to be losing the entire time portion, hence the default to midnight. Clarify for us exactly how your target column is defined in Oracle and how you are "loading" it in the job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
phanikumar
Participant
Posts: 60
Joined: Tue Sep 20, 2011 10:44 pm
Location: INDIA

Post by phanikumar »

The Oracle datatype is Timestamp(6) and the column we are loading in is of datatype timestamp.

Example:
Record in 9.1
RMA_DATE Database
20140225 060253 25/FEB/14 12:00:00.000000000 AM

Record in 8.5
RMA_DATE Database
20140225 060253 25/FEB/14 06:02:53.000000000 AM


Also tried to run the job by setting the extended property to microseconds doesn't make any difference.


I did tried to manually insert a record on database with current_timestamp into the field and the data looks good.

The issue really is when the Datastage 9.1 trying to load the data in the Database.

Regards
Kumar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If DataStage writes to a Sequential File what do you get?

Has you Oracle default date picture for this user changed?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Again, clarify for us any transformations that you are doing. Your source is what, a string? And then you do what with it to convert it to a timestamp?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sam paul
Premium Member
Premium Member
Posts: 19
Joined: Mon Jan 26, 2009 1:31 pm
Location: Minneapolis, USA

Post by sam paul »

Your record in 9.1 has data 25-Feb-2014 12:00:00.00000 which is correct in your target. Similarly with 8.5 also.

so what are you expecting as your output?
Datastage Developer cum ETL designer.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's not correct... note that the input value is "20140225 060253" in both cases and the second value is the time.
-craig

"You can never have too many knives" -- Logan Nine Fingers
phanikumar
Participant
Posts: 60
Joined: Tue Sep 20, 2011 10:44 pm
Location: INDIA

Post by phanikumar »

Hi All,

The issue has been resolved.

We are loading the table from a file and we are using a schema file to load the column definitions.

In 8.5 we are defining the column definition as timestamp in the schema file and it is populating the time component perfectly fine.

In 9.1 we are using the same file but doesn't load the time component.

Hence I changed the column definition to use microseconds and it worked fine.

Not sure why it worked...

Anyway thanks for alll your inputs.


Regards
Kumar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Because you are loading a Timestamp(6) and it needs microseconds in that case. You got away without doing it in 8.5 but could no longer in 9.1 where they've tightened things up.

Something we see all the time when they fix things in later releases that were technically broken in earlier ones and a job was reliant on the 'broken' behavior.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply