有没有办法在存储过程/包中执行ALTER SESSION SET time_zone ='America / New_York'?我想将会话TZ更改为NY,然后将其恢复为之前的状态。
答案 0 :(得分:2)
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>