开发者

Changing TIME_ZONE within PL/SQL Procedure

开发者 https://www.devze.com 2023-02-17 03:39 出处:网络
Is there a way to perform an ALTER SESSION SET time_zone=\'America/New_York\' within a stored procedure/package? I want to chan开发者_JAVA技巧ge the session TZ to NY then return it back to what it was

Is there a way to perform an ALTER SESSION SET time_zone='America/New_York' within a stored procedure/package? I want to chan开发者_JAVA技巧ge the session TZ to NY then return it back to what it was before.


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> 
0

精彩评论

暂无评论...
验证码 换一张
取 消