Oracle Time Stamp conversion

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
als110
Participant
Posts: 43
Joined: Fri Nov 05, 2004 11:21 am
Location: United States

Oracle Time Stamp conversion

Post by als110 »

I am building a hash file that must contain a date in the format yyyy-mm-dd. When I do the seelct statement from my Oracle DB in either a date or timestamp format the field does not populate into the hash file. If I pull the date into my hash file as a varchar is pulls the date in the format dd-MMM-YY (the mmm is the three digit month abreviation jan for january). Is there a way to convert this in either my sql select or in a transformer so that it loads into the hash in the yyyy-mm-dd date format.
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Re: Oracle Time Stamp conversion

Post by ogmios »

als110 wrote:I am building a hash file that must contain a date in the format yyyy-mm-dd. When I do the seelct statement from my Oracle DB in either a date or timestamp format the field does not populate into the hash file. If I pull the date into my hash file as a varchar is pulls the date in the format dd-MMM-YY (the mmm is the three digit month abreviation jan for january). Is there a way to convert this in either my sql select or in a transformer so that it loads into the hash in the yyyy-mm-dd date format.
What about using TO_CHAR(date_column, 'YYYY-MM-DD') in your Oracle SQL statement.

Ogmios
In theory there's no difference between theory and practice. In practice there is.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What stage are you using to access Oracle? The OCI stages will automatically do the TO_CHAR for you if you pick the Date or Timestamp formats and let the stage generate the DML for you. :?
-craig

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