Question about system timestamp in oracle table

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
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Question about system timestamp in oracle table

Post by ady »

I am trying to get the system date and time into a oracle table. I am using Oconv(Date(),"D,YMD[4,2,2]") and giving the datatype as Timestamp in datastage.

I get the date in the oracle table but the system time displays as 00:00:00. Do i have to give it another format to get the time . Please help
Be nice to nerds. Chances are you’ll end up working for one.

--- Bill Gates
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes... all you've handled is the Date part. You'd need to either add in a Time() function call or switch to the combo one - TimeDate? We use that one in a custom routine to get a System timestamp.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

DataStage "DATE" conversions only cover the date portion and not the time. You will need to specify

Code: Select all

OCONV(DATE(),'D4YMD[4,2,2]'):' ':OCONV(TIME(),'MTS')
. That will give you the time accurate to the nearest second without milliseconds.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The DATE() and TIME() functions refer to the system clock; they will increment over the run time of your job.
To get the job start time you can prefer the system variables @DATE and @TIME in such an expression.

Code: Select all

Oconv(@DATE, "D-YMD[4,2,2]") : " " : Oconv(@TIME, "MTS:")
Or you can simply use the DataStage macro DSJobStartTimestamp
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