В операторе блока PL SQL будет выполняться операция DML. Я использую FORALL с BULK COLLECT. PL SQL оператор упоминается ниже -
declare
v_sub tab_a%rowtype;
v_res varchar2(50);
type v_rec_tbl is table of tab_out%rowtype;
v_rec v_rec_tbl;
cursor C is select b.sid, a.sin, 'N', SYSDATE from tab_a a, tab_b b;
begin
open C;
fetch C bulk collect into v_rec limit 1000;
for i in (select a.sin from tab_a a, tab_b b where b.sid = .....)
loop
select * into v_sub from tab_a where sin = i.sin;
end loop;
FORALL i in v_rec.FIRST..v_rec.LAST
insert into tab_out
select b.sid, i.sin, 'N', SYSDATE from tab_a a, tab_b b where b.sid = ......;
commit;
close C;
end;
/
Когда я выполняю выше оператора PL / SQL, тогда получаю ошибку ORA-00904
& PLS-00487
в строке insert into tab_out
в i.sin
как Invalid Identifier
& Invalid reference to variable 'i'
. Как я могу устранить эту ошибку, чтобы запись была вставлена быстро.