create or replace package body ZPKG1 as
tab1 ZTestColl := ZTestColl();
procedure test1 as
c integer;
begin
dbms_output.put_line('testing select from table()');
select count(*) into c from table(tab1);
dbms_output.put_line('testing select from .. where exists (select * from table(tab1) t where t.id = z.id)');
select count(*) into c from Z_TEST z where exists (select * from table(tab1) t where t.id = z.id);
exception when others then
dbms_output.put_line(sqlerrm);
end;
procedure test2 as
c integer;
begin
dbms_output.put_line('testing delete from .. exists (select * from table(tab1) t where t.id = z.id)');
delete from Z_TEST z where exists (select * from table(tab1) t where t.id = z.id);
exception when others then
dbms_output.put_line(sqlerrm);
end;
procedure test3 as
c integer;
begin
dbms_output.put_line('testing update .. set val = (select ''id: '' || id from table(tab1) t where t.id = z.id)');
update Z_TEST z set val = (select 'id: ' || id from table(tab1) t where t.id = z.id);
exception when others then
dbms_output.put_line(sqlerrm);
end;
--/*
procedure test4 as
c integer;
begin
dbms_output.put_line('insert into .. select id, ''id: '' || id from table(tab1) t');
insert into Z_TEST (id, val) select id, 'id: ' || id from table(tab1) t;
exception when others then
dbms_output.put_line(sqlerrm);
end;
--*/
end;