Page 1 of 1

conversation of current_timestamp

Posted: Tue May 08, 2012 10:18 am
by times29
Hi,
I am using current_timestamp in transformer which gives ouput 2012-05-05 08:05:37
user want it to be 05/05/2012 08:05:37 . Any idea who should i do it in transformer.

Thanks

Posted: Tue May 08, 2012 10:46 am
by jerome_rajan
Use TimestampToString(CurrentTimestamp(), "%mm/%dd/%yyyy %hh:%nn:%ss")

Posted: Tue May 08, 2012 6:27 pm
by times29
i get warnings while doing it
Data string '04/24/2012 04:20:36' does not match format '%yyyy-%mm-%dd %hh:%nn:%ss': the value for tag %yyyy has fewer characters than expected.

Posted: Tue May 08, 2012 7:01 pm
by Kryt0n
You have got your output column as a varchar?

Posted: Tue May 08, 2012 7:01 pm
by ray.wurlod
Are you sure you used TimestampToString() function?

Try with peek stage

Posted: Wed May 09, 2012 9:56 am
by sreewin7
Try to load data in to peek, if you are using parellel jobs.
If that is working as per your requirmment.

Posted: Wed May 09, 2012 9:59 am
by jerome_rajan
Just a hunch. I think his target is a Timestamp field rather than a 'String' that holds a timestamp value. This could be the reason why DataStage is trying to compare the output of the TimestampToString with the default DataStage format and consequently warning the user about the mismatch

Posted: Wed May 09, 2012 4:01 pm
by ray.wurlod
Another example of why it is so important to post the complete error message - we would have been able to see which stage generated it.