17,086
社区成员
发帖
与我相关
我的任务
分享
SQL>
SQL> create table test(id int, name varchar(10));
Table created
SQL> begin
2 insert into test values(1,'aaa');
3 insert into test values(2,'bbb');
4 insert into test values(3,'ccc');
5 insert into test values(4,'ddd');
6 end;
7 /
PL/SQL procedure successfully completed
SQL> set serverout on ;
SQL> declare
2 type tlist is table of integer index by pls_integer;
3 l tlist ;
4 v_id varchar(10);
5 begin
6 update test set name = name || 'XXX' returning id bulk collect into l;
7 for x in 1..l.count loop
8 dbms_output.put_line(l(x));
9 end loop;
10 end;
11 /
1
2
3
4
PL/SQL procedure successfully completed
SQL> drop table test purge;
Table dropped
SQL>