1 year ago
#199360
João
How to handle TZ names in Sybase IQ 16
In the context of a file ETL process (plain shell + BCP to temporary table + import to final table stored procedure), have a new complication with a import of data from a remote Oracle Database into a Sybase IQ 16 Database.
Data to import has a timestamp (YYYY-MM-DD HH:MI:SS
) without timezone and an additional field with the TZ name (eg Europe/Zurich
). Information is to be stored all in UTC+0.
Oracle has specific TimeZone function TO_TIMESTAMP_TZ
that has no match in IQ database. The simpler solution I see would be to have source send a timestamp with timezone. And then use SWITCHOFFSET
function. But I have limited influence to change the source system format.
Sybase IQ example of changing offset on a timestamp with time zone would be:
SELECT CAST ( '2022-02-18 14:45:12.123+01:00' AS datetimeoffset ) AS dt_originalTZ, SWITCHOFFSET( dt_originalTZ,'+00:00' ) AS dt_destinationTZ;
--dt_originalTZ,dt_destinationTZ
--'2022-02-18 14:45:12.123+01:00','2022-02-18 13:45:12.123+00:00
The time/budget is limited, I don't believe it would be viable at IQ database side to build a new custom function to map all possible TZ names to offsets. This alternative main complexity would be handling daylight time savings.
I also don't want to create a hacked solution depending on let's say shell in linux server transforming the input file, since that would create more particular cases, with more possible failing points and more dependencies to manage.
Am I missing any simpler approach that might save the day?
timezone
sybase
timezone-offset
sap-iq
0 Answers
Your Answer