开发人员遇到的一个问题:
一个存储过程在开发环境中可能使用,
迁移到正式环境中编译报这个错误,原因是数据类型不一致
[@more@]在一个XML处理存储过程中,使用了dbms_xmldom包,
当从开发环境向正式环境中迁移时,遇到PLS-00801: internal error [pdticv:CHR/AFC
网上有人说是10G的程序向9迁时的问题,Maaher说是数据类型不一致的原因,经过查找,确定是数据类型不一致的原因.相关链接:
http://www.orafaq.com/forum/t/58400/2/
you are trying to assing a VARCHAR2 column to a locally declared type. I could easily reproduce it.
Code: [
Select all] [
Show/ hide]
SQL> declare 2 type emp_1_rec is record(v_name varchar2(30)); 3 type emp_2_rec is record(name emp_1_rec); 4 name_tab emp_2_rec; 5 cursor c1 is select last_name from employees; 6 begin 7 open c1; 8 loop 9 fetch c1 into name_tab; 10 exit when c1%notfound; 11 dbms_output.put_line(name_tab.name.v_name); 12 end loop; 13 end; 14 / declare * ERROR at line 1: ORA-06550: line 0, column 0: PLS-00801: internal error [pdticv:CHR/AFC->]
But if you explicitly store it in the VARCHAR2 member of your type, all works well. Pay attention to line 9.
Code: [
Select all] [
Show/ hide]
SQL> declare 2 type emp_1_rec is record(v_name varchar2(30)); 3 type emp_2_rec is record(name emp_1_rec); 4 name_tab emp_2_rec; 5 cursor c1 is select last_name from employees; 6 begin 7 open c1; 8 loop 9 fetch c1 into name_tab.name; 10 exit when c1%notfound; 11 dbms_output.put_line(name_tab.name.v_name); 12 end loop; 13 end; 14 / King Kochhar De Haan <<...snip...>> Higgins Gietz PL/SQL procedure successfully completed.
Lesson learnt: make sure both sides of an assignment are of the same type

MHE
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/271063/viewspace-1029322/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/271063/viewspace-1029322/