Stored procedures 更改PL/SQL过程中的时区
有没有一种方法可以在存储过程/包中执行ALTER SESSION SET time_zone='America/New_York'呢?我想将会话TZ更改为NY,然后将其返回到以前的状态Stored procedures 更改PL/SQL过程中的时区,stored-procedures,plsql,oracle11g,Stored Procedures,Plsql,Oracle11g,有没有一种方法可以在存储过程/包中执行ALTER SESSION SET time_zone='America/New_York'呢?我想将会话TZ更改为NY,然后将其返回到以前的状态 SQL> begin 2 execute immediate 'alter session SET TIME_ZONE=''America/New_York'''; 3 end; 4 / PL/SQL procedure successfully completed SQL>
SQL> begin
2 execute immediate 'alter session SET TIME_ZONE=''America/New_York''';
3 end;
4 /
PL/SQL procedure successfully completed
SQL> select sessiontimezone from dual
2 /
SESSIONTIMEZONE
---------------------------------------------------------------------------
America/New_York
SQL>