[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Converting 'timestamp with time zone' into 'timestamp' datatype..

Posted on 2011-09-07
6
Medium Priority
?
619 Views
Last Modified: 2012-05-12
i have data with 'TIMESTAMP(6) WITH TIME ZONE' ...
2 example values:
02/10/2011 12:05:05.000000 AM -05:00
05/17/2011 03:20:19.000000 AM -04:00
can you give a query to convert this into TIMESTAMP datatype after adding the TZR value..?
0
Comment
Question by:Rao_S
  • 3
  • 2
6 Comments
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 36498192
What is the desired output?
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 total points
ID: 36498193
if you're just trying to get the GMT time


CAST(SYSTIMESTAMP AT TIME ZONE 'GMT' AS TIMESTAMP)
0
 

Author Comment

by:Rao_S
ID: 36498223
thanks sdstuber, that is what i what looking for....
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 2000 total points
ID: 36498232
if you "really" wanted to do the offset math yourself you could do it like this...



   CAST(SYSTIMESTAMP AS TIMESTAMP)
       - NUMTODSINTERVAL(EXTRACT(TIMEZONE_HOUR FROM SYSTIMESTAMP), 'hour')
       - NUMTODSINTERVAL(EXTRACT(TIMEZONE_MINUTE FROM SYSTIMESTAMP), 'minute')


but,  I recommend using the "AT TIME ZONE" method, simpler and more efficient.

as above,  use your own timestamp value for systimestamp
0
 

Author Comment

by:Rao_S
ID: 36498258
thank you...i like the 'at time zone' also.....!...
0
 

Author Closing Comment

by:Rao_S
ID: 36505022
thank you...
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question