日期:2014-05-16  浏览次数:20483 次

oracle-----list,array
定义
type idList_type is table of emp.id%type;
type namelist_type is table of emp.name%type;
idlist idlist_type;  
namelist  namelist_type;
begin
   open emp_cv for select id,name from emp;
   fetch emp_cv bulk collect into idlist,namelist;   //这个语句一次性就放入了
   close emp_cv;
   for i in idlist.first .. idlist.last loop
       dbms_output.put_line(idlist(i));
    end loop;
end;