Declare type deptno_coll is table of dept.deptno%type; type dname_coll is table of dept.dname%type; type loc_coll is table of dept.loc%type; deptno_listdeptno_coll; dname_listdname_coll; loc_listloc_coll; begin select * bulk collect into deptno_list,dname_list,loc_list from dept; end;
在Release 2中,可以用下面的代码实现同样的功能:
Declare type dept_coll is table of dept%rowtype; dept_listdept_coll; begin select * bulk collect into dept_list from dept; end;
Declare foorowfootab%rowtype; begin insert into footab (foono,fooname) values (fooseq.nextval,'Foo') returning foono,fooname into foorow.foono,foorow.fooname; end;
而现在你可以把插入语句简化为:
insert into footab (foono,fooname) values (fooseq.nextval,'Foo') returning foono,fooname into foorow;