oracle 存储过程的用法

create or replace procedure  myPro(inParams in number,outParams out number) is

str varchar(200);

begin 

----if的用法

if inParams>0 then

begin outParams:=1;

end;

end if;

-----for的用法:配合游标使用

Cursor cursor is select id,name,sex,age from user ;id number;name varchar(20);sex char(1);age number;

begin 

for id,name,sex,age in cursor LOOP

begin 

str:=id+','+name+','+sex+','+age;

dbms_output.publine(str);

end;

end LOOP;

end myPro;

原文地址:https://www.cnblogs.com/dreamzcy/p/6221236.html