0
CREATE OR REPLACE  procedure abc
IS
TYPE abc is table of varchar2(200);
v_nt abc; 

BEGIN

select 'update emp_test set ename=''gaurav'' ' bulk collect into v_nt from emp;

forall i in v_nt.first..v_nt.last
execute immediate v_nt(i);

END; 
/

嗨,我正在创建上述过程并获得编译时错误,如下所示:

Compilation errors for PROCEDURE SCOTT.ABC

Error: PLS-00801: internal error [*** ASSERT at file pdw4.c, line 586; Unknown expression Expr = 283.; ABC__SCOTT__P__53497[11, 1]] Line: 11 Text: execute immediate v_nt(i);

我该如何解决这个问题,因为我需要批量进行此交易。

4

1 回答 1

1

下面应该工作

CREATE OR REPLACE procedure abc IS
  TYPE abc is table of varchar2(200);
  v_nt abc;
BEGIN
  select 'gaurav' bulk collect into v_nt from emp;
  forall i in v_nt.first .. v_nt.last 
  execute immediate 'update emp_test set ename=:1' using v_nt(i);
END;
      /

虽然下面也达到了同样的结果

CREATE OR REPLACE procedure abc IS
 BEGIN
     execute immediate 'update emp_test set ename=''gaurav'' ';
 END;
       /
于 2012-04-13T11:13:44.810 回答