Solved

how does PST/PDT and TZR/TZD works.

Posted on 2014-02-12
6
1,169 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 73

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 73

Expert Comment

by:sdstuber
ID: 39856672
exec TZ_TST ;


you don't have a parameter
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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 73

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 73

Expert Comment

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


tz_tst requires a parameter
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Remove Hyphens in Oracle SQL 5 46
Salary Amount Format 13 56
Single ERP VS muttiple Application or Systems 6 41
PL/SQL LOOP CURSOR 3 42
Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now