Skip to content

Instantly share code, notes, and snippets.

@s-oravec
Created October 9, 2018 15:23
Show Gist options
  • Select an option

  • Save s-oravec/b5f79644339c24b44ccc9a8024a5f56e to your computer and use it in GitHub Desktop.

Select an option

Save s-oravec/b5f79644339c24b44ccc9a8024a5f56e to your computer and use it in GitHub Desktop.
returning bulk collect into
drop table x ;
drop type integer_tab_type;
create table x (id integer primary key, v varchar2(10));
create type integer_tab_type as table of integer;
insert into x values (1, 'a');
insert into x values (2, 'b');
commit;
declare
t integer_tab_type;
begin
update x set v = 'x' where v = 'a' returning id bulk collect into t;
dbms_output.put_line(t.count());
end;
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment