读书人

怎样写Exception when

发布时间: 2014-01-28 21:23:43 作者: rapoo


现在需要写这样的一个过程,结果返回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 ***;

        

读书人网 >oracle

热点推荐