FORALLステートメントはまさにそれです。声明; その中でできることは1つだけです。タイプをもう一度ループする必要があります。
forall indx in p_product.first .. p_product.last
insert into my_table
values (p_product(indx), p_product_desc(indx), p_msg);
for indx in p_product.first .. p_product.last loop
remove_dup_products(p_product(indx));
end loop;
2 つの DML ステートメントを実行していないことには何の価値もありません。あなたはそれをやっていて、手続きを呼んでいます。したがって、FORALL を 2 回使用することはできません。通常の for ループを使用する必要があります。
2 番目の手順で DMLのみを実行している場合は、コレクション全体を渡してから FORALL を使用できます。グローバル変数を宣言する必要があります。
create or replace package something is
type t__product is table of product.product%type;
t_product t__product;
...
そして、これをどこでも再利用できます
create or replace package body something is
procedure current_proc is
begin
forall indx in p_product.first .. p_product.last
insert into my_table
values (p_product(indx), p_product_desc(indx), p_msg);
remove_dup_products(p_product);
end current_proc;
-------------------------------------------------------------
procedure remove_dup_products (p_product in t_product) is
begin
forall in p_product.first .. p_product.last
delete ...