TimeStamp in 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
muascdev
Charter Member
Charter Member
Posts: 51
Joined: Tue Oct 10, 2006 5:48 pm

TimeStamp in oracle

Post by muascdev »

I need to update a timestamp filed when we update a record, ad we use oracle 9i. in th transformer there is TimeDate() function whic is in this format 'HH24:MI:SS DD MON YYYY' and when the sql is genarated its in this format 'YYYY-MM-DD hh24:mi:ss'. how do i convert the time stamp in transformer into this format. thanks
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Look at the ICONV and OCONV functions. They should help you converting what you need. Also check the function DSJOBStartTimeStamp if you need current timestamp
Kris

Where's the "Any" key?-Homer Simpson
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you need the system time "now", or the system time when the job started?

If the former, you could use SYSDATE as the default value for the column and not insert it from the DataStage job. Or

Code: Select all

Oconv(Date(), "D-YMD[4,2,2]") : " " : Oconv(Time(), "MTS:")
If the latter, the DSJobStartTimestamp macro delivers the correct format. Or substitute @DATE for Date() and @TIME for Time() in the above expression.
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