create or replace PRocedure StudyCursor( resulst out integer ) is v_tablename varchar(30); v_tabletype varchar(11); cursor mycursor is select * from cat; begin open mycursor; loop fetch mycursor into v_tablename,v_tabletype;
null; --you can use tablename and v_tabletype end loop; close mycursor; end StudyCursor;
最近在看代码是,发现其实我们还有一个更方便的方法就是使用for in loop … end loop
create or replace procedure StudyFor( resulst out integer ) is begin for emm in(select * from cat) loop null; --you can use emm.table_name and emm.table_type end loop; return ; end StudyFor;