首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

怎样写Exception when

2014-01-28 
现在需要写这样的一个过程,结果返回Y或者N 无任何Oracle异常时返回Y 有Oracle异常时返回N 怎样写Exception


现在需要写这样的一个过程,结果返回Y或者N

无任何Oracle异常时返回Y

有Oracle异常时返回N

怎样写Exception when ?

------解决方法--------------------------------------------------------
 

怎样写Exception when?

create or replace procedure myProcedure(as_ret out varchar2)
as
begin
--编写你需要执行的;
-- ....

-- 最后
as_ret := 'Y ';
exception when others then
as_ret := 'N ';
end myProcedure;
------解决方法--------------------------------------------------------
exception when others then
raise ***;

        

热点排行