您的位置:首页 > 数据库 > Oracle

Oracle存储过程编写

2017-02-14 15:25 441 查看
oracle存储过程:

create or replace procedure 存储过程名(param1 in type,param2 out type)

as 

 变量1 类型(值范围);--vs_msg varchar2(40000);

 变量2 类型(值范围);

begin
 select count(*) into 变量1 from 表A where 列名=param1;
 if(判断条件) then
   select 列名 into 变量2 from 表A where 列名=param1;
   dbms_output.put_line('打印信息');
 elsif(判断条件) then
   dbms_output.put_line('打印信息');
 else
   raise 异常名(NO_DATA_FOUND);
 end if;
 exception
 when others then
   rollback;

end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: