oracle数据库存储过程与函数小例子



-----function
create or replace
function isNumber ( strNum in varchar2 )
return   char
is
   chkNum number;
begin
   chkNum := to_number(strNum);
   return 'Y';
exception
   when others
   then return 'N';
end isNumber;

declare
ww varchar2(10):='17';
begin
    dbms_output.put_line(isNumber(ww));
end;

-----procedure
create or replace
procedure isNumber2 ( strNum in varchar2 )
is
   chkNum number;
begin
   chkNum := to_number(strNum);
   dbms_output.put_line(chkNum);
exception
   when others
   then null;
end isNumber2;


call isNumber2('13');

你可能感兴趣的:(oracle)