如何创建存储过程

隐式cursor示例:

create or replace procedure get_news
as   
counts number;
begin  
  for rec in (select test,name from test) loop
    select count(*) into counts from test1 where id=rec.name;
      dbms_output.put_line('insert='||rec.test||'--'||counts);
  end loop; 
end;

参考资料:
http://diegoball.iteye.com/blog/462979
http://kiral.iteye.com/blog/1129908

你可能感兴趣的:(oracle)