不求每天都有非常大的收获,但是希望每天多多少少有些收获,这样才能对得起自己。今天给大家带来的是两个本人的发现:
1、参数fixed_date
该参数用来固化sysdate返回值。不会对其它日期型数据产生影响。一般仅仅是用来测试之用,请看下面的demo:
SQL> show parameter fixed_date
NAME TYPE VALUE ------------------------------------ ----------- ------------------
fixed_date string SQL> alter system set fixed_date='yyyy-mm-dd hh24:mi:ss'; alter system set fixed_date='yyyy-mm-dd hh24:mi:ss' * ERROR at line 1: ORA-02097: parameter cannot be modified because specified value is invalid ORA-02078: invalid setting for ALTER SYSTEM FIXED_DATE
SQL> alter system set fixed_Date='1920-01-01';
System altered.
SQL> select sysdate from dual;
SYSDATE ---------
01-JAN-20
|
2、alter session enable|disable commit in procedure.
该语句一般用来在会话级别限制在过程、函数、包中启用或者禁用commit操作。默认情况下是允许在plsql对象中使用commit的,当然trigger例外。
请看以下demo:
SQL> conn test/test Connected. SQL> create or replace procedure p_test as 2 begin 3 commit; 4 end; 5 /
Procedure created.
SQL> exec p_test;
PL/SQL procedure successfully completed.
SQL> alter session disable commit in procedure;
Session altered.
SQL> exec p_test; BEGIN p_test; END;
* ERROR at line 1: ORA-00034: cannot COMMIT in current PL/SQL session ORA-06512: at "TEST.P_TEST", line 3 ORA-06512: at line 1
|
记录下来,便于查阅!
阅读(1943) | 评论(0) | 转发(0) |