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

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

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

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

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

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

转载于:http://blog.itpub.net/271063/viewspace-1029322/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值