我寫一包如下: -光標內的所有PLSQL
create or replace package body pack_name
is
cursor is cur_get_data(p_run_id)
is
select p_run_id run_id,
person_id ,
emp_name
from abc;
TYPE demo_table_type IS TABLE OF get_demo_data%ROWTYPE;
demo_table demo_table_type;
procedure demo_data(p_data_array IN demo_table_type)
is
cursor is cur_get_person(p_person_id number)
is
select tot_comp_annual
from xyz;
begin
FORALL j IN 1 .. p_data_array.COUNT SAVE EXCEPTIONS
insert
INTO table_bad (run_id, person_id,emp_name)
VALUES (p_data_array (j).run_id,
p_data_array (j).person_id,
p_data_array (j).emp_name);
end;
現在的問題是,我想打開cur_get_person並傳遞我從p_data_array得到爲person_id(J).person_id和將該值插入table_bad的列annual_comp中。我怎樣才能做到這一點 ?
與福爾,這是不可能的。據我所知,Forall只承認一次dml操作 – Aramillo