Page 1 of 1

Oracle Time Stamp conversion

Posted: Thu Dec 23, 2004 1:34 pm
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.

Re: Oracle Time Stamp conversion

Posted: Thu Dec 23, 2004 1:58 pm
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

Posted: Thu Dec 23, 2004 2:02 pm
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. :?