SYSDATE 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
lrashley
Participant
Posts: 3
Joined: Mon Mar 29, 2004 8:06 am
Location: Arlington, VA
Contact:

SYSDATE in Oracle

Post by lrashley »

Hi Everyone,

Is there a way to use the Oracle SYSDATE function when populating a date field in a Oracle target table?

I have tried to use syntax such as Oconv(date(), "D4-DMY") in stage variables, but I can't get the format right for Oracle. Even when I just use a string such as "01-JAN-2004" I still get an ODBC error. What's the secret to populating today's date in Oracle?

Thanks,

Larry
lrashley
Participant
Posts: 3
Joined: Mon Mar 29, 2004 8:06 am
Location: Arlington, VA
Contact:

Re: SYSDATE in Oracle

Post by lrashley »

lrashley wrote:Hi Everyone,

Is there a way to use the Oracle SYSDATE function when populating a date field in a Oracle target table?

I have tried to use syntax such as Oconv(date(), "D4-DMY") in stage variables, but I can't get the format right for Oracle. Even when I just use a string such as "01-JAN-2004" I still get an ODBC error. What's the secret to populating today's date in Oracle?

Thanks,

Larry


Think I'll answer my own post this time:

To use SYSDATE, simply add a new column in the source stage and set the derivation to 'SYSDATE'. Then you can just link this column to the target field.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's certainly one way. You can also handle it at the target side by using Custom Sql, leaving the target field out of the column list and using 'SYSDATE' as its value in the SQL.

You'll find this Forum has quite a bit of information in it. Between it and the Oliver archives that are hosted here, you'll find that most questions have already been asked and answered. Usually several times. Much like this one. :wink:

Oh, and welcome aboard!
-craig

"You can never have too many knives" -- Logan Nine Fingers
nkumar_home
Participant
Posts: 19
Joined: Fri Apr 02, 2004 10:13 am

Re: SYSDATE in Oracle

Post by nkumar_home »

lrashley wrote:Hi Everyone,

Is there a way to use the Oracle SYSDATE function when populating a date field in a Oracle target table?

I have tried to use syntax such as Oconv(date(), "D4-DMY") in stage variables, but I can't get the format right for Oracle. Even when I just use a string such as "01-JAN-2004" I still get an ODBC error. What's the secret to populating today's date in Oracle?

Thanks,

Larry
You can also define the column as a Timestamp and use the following code to populate -> OCONV(DATE(), "D4-YMD[4,2,2]") : " " : OCONV(TIME(), "MTS:")

Naren
Post Reply