见Bug No. 4171597 or 4230721,影响版本10.1.0.3.0以后,最晕的是 Fixed in Product Version: No Data。可见,这个问题,拖了这么长时间了,oracle居然没有一个解决办法。。。
还害得我找问题在哪里,以为10g有什么改变了,结果文档就是这么写的,一点没有变化,再查metalink,ft。
- /*Create a test table */
- SQL>CREATE TABLE T ( THEVAL NUMBER(12))
- /*Create a before insert trigger on the table which uses ora_sql_txt function. */
- SQL>CREATE OR REPLACE TRIGGER T_TRIGGER
- BEFORE INSERT ON T
- DECLARE
- sql_text ora_name_list_t;
- stmt VARCHAR2(32300);
- n NUMBER;
- BEGIN
- stmt := NULL;
- dbms_output.put_line( 'The statement that caused me to fire is:' );
- n := ora_sql_txt(sql_text);
- FOR i IN 1..n LOOP
- BEGIN
- stmt := stmt || sql_text(i);
- END;
- END LOOP;
- dbms_output.put_line( stmt );
- END;
- /
Insert values in the table
insert into t values(123);
This fails with :
insert into t values(123)
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SCOTT.T_TRIGGER", line 9
ORA-04088: error during execution of trigger 'SCOTT.T_TRIGGER'
As variable n contains NULL
a) 9.2.0.6
--> ora_sql_txt() returns 1
sql_text(1) returns "insert into t values(123)"
b) 10.1.0.3 & 10.2
--> ora_sql_text() returns null
sql_text collection is uninitialised
上一篇: « 高端存储体系介绍–IBM ds8000系列
下一篇: 高端存储体系介绍–HDS USP系列 »
- 发表评论


