Page 1 of 1

GMT conversion before loading to Oracle Exadata

Posted: Tue Oct 16, 2018 12:18 pm
by DSFreddie
Hi All,

Are there any ways to convert a current timestamp to GMT format using Datastage prior to loading to Oracle Exadata ? I couldn't find any specific functions in transformer nor arrive at a solution.

Any help/thoughts are appreciated.



Thanks
Freddie

Posted: Tue Oct 16, 2018 3:34 pm
by ray.wurlod
Do you have a specific format in mind? (For example, the military use a Z to indicate GMT.)

The TimestampOffsetByComponents() function is probably the easiest to use (assuming you already have a timestamp) to handle the difference in hours. Interrogate the TZ environment variable to determine the number of hours to shift.

Posted: Tue Oct 16, 2018 7:38 pm
by DSFreddie
Thanks for your reply Ray.

There is no specific format requirement, all we need to do is convert the current date to a valid GMT Timestamp format.

Pls let me know if TimestampOffsetByComponents() function will work in this case.

Thanks
Freddie

Posted: Tue Oct 16, 2018 8:20 pm
by ray.wurlod
Timestamp and Date are different in DataStage, unlike Oracle. If you have a date, then you may need to convert that to a timestamp before providing it as an argument to TimestampOffsetByComponents(). Or you can rely on it being handled properly by DataStage as an implicit conversion.

Yes, it will work.