ITPub博客

首页 > 数字化转型 > ERP > PLS-00801: internal error [pdticv:CHR/AFC

PLS-00801: internal error [pdticv:CHR/AFC

原创 ERP 作者:wmlm 时间:2009-12-03 15:25:46 0 删除 编辑

开发人员遇到的一个问题:

一个存储过程在开发环境中可能使用,

迁移到正式环境中编译报这个错误,原因是数据类型不一致

[@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.

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.

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 Wink.
MHE

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

上一篇: 昨天
下一篇: rac ora-12545
请登录后发表评论 登录
全部评论

注册时间:2008-04-08

  • 博文量
    398
  • 访问量
    3716783