|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Insert timestamp with local timezone |
« View previous topic :: View next topic » |
Author |
Message
|
maurito |
Posted: Wed Feb 03, 2016 12:23 pm Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
well, no, you need to try something like
Code: |
passthru ( insert into tablename (col1, col2) values (value1, TIMESTAMP(whatever)) |
Having said that, if it works, you need to make sure that the data stored in the database is correct |
|
Back to top |
|
|
jgonz |
Posted: Mon Feb 08, 2016 11:24 am Post subject: |
|
|
Novice
Joined: 20 Nov 2015 Posts: 16
|
maurito wrote: |
well, no, you need to try something like
Code: |
passthru ( insert into tablename (col1, col2) values (value1, TIMESTAMP(whatever)) |
Having said that, if it works, you need to make sure that the data stored in the database is correct |
Ahh, yes this works! I did the following:
Code: |
DECLARE startResult CHAR CAST(startTime AS CHAR FORMAT 'yyyy-MM-dd HH:mm:ss.SSSSSSZZZ');
DECLARE endResult CHAR CAST(endTime AS CHAR FORMAT 'yyyy-MM-dd HH:mm:ss.SSSSSSZZZ');
PASSTHRU('INSERT INTO TEST_TIMESTAMPS (
TIMESTAMP_,
TIMESTAMP_TIMEZONELOCAL,
TIMESTAMP_WITH_LOCALTIMEZONE
) VALUES (?,
TO_TIMESTAMP_TZ(?, ''YYYY-MM-DD HH24:MI:SS.FF6TZH:TZM''),
TO_TIMESTAMP_TZ(?, ''YYYY-MM-DD"T"HH24:MI:SS.FF3TZH:TZM'')
)',
CAST(CURRENT_TIMESTAMP AS CHAR),
startResult,
endResult
); |
|
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|