Assigning current date and time in the transformer

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
Bhusan
Premium Member
Premium Member
Posts: 15
Joined: Wed Jul 07, 2004 4:04 pm

Assigning current date and time in the transformer

Post by Bhusan »

How do I assign current timestamp into timestamp field in Oracle table? I am trying to do that in a transformer.

Thanks.
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Hi


Use the @TIME function in the transformation step. Datastage has time() / timedate() function which can also be used.

Make sure you change the time to the correct format to your oracle database.

Cheers
Siva
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post by chucksmith »

Also, look at some of the marcos. I like to use the DataStage job start timestamp.
peternolan9
Participant
Posts: 214
Joined: Mon Feb 23, 2004 2:10 am
Location: Dublin, Ireland
Contact:

Re: Assigning current date and time in the transformer

Post by peternolan9 »

Bhusan wrote:How do I assign current timestamp into timestamp field in Oracle table? I am trying to do that in a transformer.

Thanks.
Bhusan,
I put :

Ans = (OCONV(DATE(), "D4-YMD[4,2,2]") : " " : OCONV(TIME(), "MTS:"))

into a routine called GetSystemTimeStamp and then I call that function in my transformers.....

I did it this way because if we ever change databases the length of the timestamp string will be different. Oracle uses 19, SQL Server 23, Sybase IQ 23. Then I can just change one routine in one place.

By doing it this way I can move databases...also, I wrote a tool and published it on my web site www.peternolan.com that allows editting of DS XML....so if we ever move databases I can edit the properties of fields en-mass......

All,
Call me crazy, but I just don't think everyone should use oracle all the time for everything.. ;-)

And I think it is wise for any customer, when they negotiate support and upgrade fees with Oracle, to be able to tell Oracle that they can move the DW to any ODBC compliant database with minimal effort, and are willing do do so unless Oracle helps out on support/maintenance fees.....if you can't move, no discount, simple as that...;-)

Just my 2c worth...or, if we count my 2c + Oracle fees.....

My gazzillion dollar tip.. (LOL)...
Best Regards
Peter Nolan
www.peternolan.com
Post Reply