Avec INSERT ... SELECT, plusieurs lignes peuvent être insérées. Une clause RETURNING devrait donc retourner plusieurs clés, mais RETURNING BULK COLLECT INTO ne fonctionne pas avec les insertions Oracle.
Le contournement consiste à utiliser FORALL :
declare
type new_rows is table of tbl_xxx%rowtype;
rec_xxx new_rows;
type new_keys is table of tbl_xxx.cola%type;
col_xxx new_keys;
begin
select cola * 10, colb, colc
bulk collect into rec_xxx
from tbl_yyy;
forall idx in 1 .. rec_xxx.count()
insert into tbl_xxx values rec_xxx(idx)
returning tbl_xxx.cola bulk collect into col_xxx;
end;
/