Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    5

    Unanswered: How can I get the dbtimezone when coding PL/SQL?

    Hi,
    I want to get the value of dbtimezone in my PL/SQL program. I get an error message which I found very strange. Let me explain it with examples. I wrote the below SQL sentence from SQL PLUS and it works:
    SQL> select dbtimezone from dual;

    DBTIMEZ
    -------
    +03:00
    But when I wrote the same sentence in PL/SQL as:
    "SELECT dbtimezone INTO v_dbtimezone FROM DUAL;"
    I get the following error:
    "PLS-00201: identifier 'DBTIMEZONE' must be declared"
    I need some explanation about the reason and how I can get the dbtimezone value in PL/SQL block.

  2. #2
    Join Date
    Feb 2005
    Posts
    5

    solved

    Hi all,

    I have solved the problem by using "execute immediate 'select dbtimezone FROM DUAL' into v_time"

  3. #3
    Join Date
    Feb 2004
    Posts
    37
    Run the following on SQLPLUS:

    set serverout on
    declare
    v_time_zone VARCHAR2(10);
    BEGIN
    select dbtimezone INTO V_TIME_ZONE FROM DUAL;
    dbms_output.put_line(V_TIME_ZONE);
    END;
    /

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •