Inserting Oracle Date and Time data

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
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,
Before you establish connection to datastage,
call sqlplus in shell script,
alter the session in shell script
and then call datastage job using dsjob in shell script.

Ketfos
davidnemirovsky
Participant
Posts: 85
Joined: Fri Jun 04, 2004 2:30 am
Location: Melbourne, Australia
Contact:

Post by davidnemirovsky »

I would use the TO_DATE function personally, but if you can't you will have to use Iconv and Oconv:

Code: Select all

Oconv(Iconv(YourDate, "D-YMD[4,2,2]"), "D-DMY[2,A3,2]")
Cheers,
Dave Nemirovsky
xcb
Premium Member
Premium Member
Posts: 66
Joined: Wed Mar 05, 2003 6:03 pm
Location: Brisbane, Australia
Contact:

Post by xcb »

You should be able to load an oracle date field directly from an OCI stage or an ODBC stage, as long as the date is formatted corectly eg. yyy-mm-dd hh24:mi:ss. These stages automatically put the dates in the TO_DATE function for you.
Cameron Boog
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly! :wink: Set the data type to Date or Timestamp and the Oracle stages will automatically use the appropriate TO_DATE function. That's why it's important to make sure the fields are properly formatted before they hit the output stages. BTW, as noted, only two digits for the seconds are allowed in an Oracle DATE field.

It's all in the pdf documentation for the various stages, you'll find them in the 'Docs' directory under your client install directory.
-craig

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