Insert timestamp with timezone in database
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Christian
am 26 Jul. 2021
Kommentiert: Christian
am 30 Jul. 2021
Hi,
I'd like to insert (table) data into an Oracle database. The data contains datetime variables with timezone information which should be inserted into a oracle table with type timestamp with timezone.
sqlwrite (or similar) function can add/transform datetime to timestamp (oracle), but not to timestamp with timezone. The only workaround I've found is a direct linewise exec insert sql statement (insert into table () values ().... ) whereas datetime timezone is set to UTC and is formatted like
strcat('to_timestamp_tz(''', datestr(tbl.TS ,'dd.mm.yyyy HH:MM'), ' 00:00'', ''dd.mm.yyyy HH24:MI TZH:TZM'')')
Not very elegant and fast...
I'm using R19b.
Thanks for any hints...
Christian
0 Kommentare
Akzeptierte Antwort
Shadaab Siddiqie
am 30 Jul. 2021
From my understanding you want to insert timestamp with time zone in database. Since this is some sort of custom format that you want inserted into your database from my understanding you must create a workaround it (as you have already done) and there might not be another elegant way to do it.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Database Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!