Solved

how does PST/PDT and TZR/TZD works.

Posted on 2014-02-12
6
1,337 Views
Last Modified: 2014-03-04
select to_timestamp_tz ('Mon feb11 12:00:56 PDT 2013', 'Dy Mon DD HH24:MI:SS TZR YYYY') from dual
                        *
ERROR at line 1:
ORA-01882: timezone region not found


but this works.

select to_timestamp_tz ('Mon feb11 12:00:56 PST 2013', 'Dy Mon DD HH24:MI:SS TZR YYYY') from dual;

TO_TIMESTAMP_TZ('MONFEB1112:00:56PST2013','DYMONDDHH24:MI:SSTZRYYYY')
---------------------------------------------------------------------------
11-FEB-13 12.00.56.000000000 PM PST

select to_timestamp_tz ('Mon feb11 12:00:56 PST 2013', 'Dy Mon DD HH24:MI:SS TZD  YYYY') from dual;

TO_TIMESTAMP_TZ('MONFEB1112:00:56PST2013','DYMONDDHH24:MI:SSTZDYYYY')
---------------------------------------------------------------------------
11-FEB-13 12.00.56.000000000 PM -05:00

can you share me some good info on works PST/PDT or CST/CDT and TZR/TZD
0
Comment
Question by:ajaybelde
  • 4
  • 2
6 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 39854743
From the Oracle SQL Reference


TZD
Daylight saving information. The TZD value is an abbreviated time zone string with daylight saving information. It must correspond with the region specified in TZR. Valid in timestamp and interval formats, but not in DATE formats.



TZR
Time zone region information. The value must be one of the time zone region names supported in the database. Valid in timestamp and interval formats, but not in DATE formats.



http://docs.oracle.com/cd/E11882_01/server.112/e41084/sql_elements004.htm#SQLRF51079


In otherwords....

TZR is the "standardized" name for the zone.
TZD represents both the location and the daylight saving status  (PST vs PDT)
0
 

Author Comment

by:ajaybelde
ID: 39856576
create or replace
PROCEDURE TZ_TST
(out_put OUT SYS_REFCURSOR)
AS
BEGIN
  open out_put for
  select to_timestamp_tz ('Mon feb 15 00:00:56 PST 2013', 'Dy Mon DD HH24:MI:SS TZD YYYY') from dual;

  NULL;
END TZ_TST;


when iam calling this got an error.

exec TZ_TST ;
BEGIN TZ_TST ; END;

      *
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'TZ_TST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

how to call the proc
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 39856672
exec TZ_TST ;


you don't have a parameter
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ajaybelde
ID: 39856704
SQL> exec TZ_TST ;
BEGIN TZ_TST ; END;

      *
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'TZ_TST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

is not working anything wrong in procedure
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 39903739
why the penalty?

your last comment was simply a repeat of your previous comment and I had already answered it.

exec TZ_TST ;

is incorrect syntax.  
you don't have a parameter
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 39903755
PROCEDURE TZ_TST
(out_put OUT SYS_REFCURSOR)


tz_tst requires a parameter
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle Listener Not Starting 11 66
Creation date for a PDB 5 63
Error querying database link from Oracle 10g to Postgresql 7 103
setting local variables in a cursor block 3 30
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to take different types of Oracle backups using RMAN.

726 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