后续引用都用用子查询,这个扯蛋! 用with表达式,只能紧跟一段语句,且还不能with xx as () begin ...1;...2; end; 用游标cursor,用这个都是一行一行处理,一个一个标量分开来与集合处理方式有点背得太远 用表类型(table由record或object构成),但表类型是数组不是表,除非强制转换成集合处理时才能满足select * from tabtype(xx);但表类型提前创建又是一个麻烦,与其用此还不如用临时表!
各位仁兄还有什么好的经验和办法没,?
------解决方案--------------------
declare type r is record( i number, w number); r1 r; begin select 1 a, 2 b into r1 from dual; dbms_output.put_line(r1.i ------解决方案-------------------- r1.w); end;
如果需要存储多条记录(表结构): type t is table of r index by pls_integer; ------解决方案--------------------
declare type r is record( i number, w number); r1 r; begin select 1 a, 2 b into r1 from dual; dbms_output.put_line(r1.i ------解决方案-------------------- r1.w); end;
如果需要存储多条记录(表结构): type t is table of r index by pls_integer;