PL SQL Program For handle user defined error.
declare
a number(3);
b number(3);
c number(3);
divide_error exception;
begin
a:=&a;
b:=&b;
if(b=0) then
raise divide_error;
end if;
c:=a/b;
dbms_output.put_line('The Value of '||a||' / '||b||' is '||c);
exception
when divide_error then
dbms_output.put_line('A Number can not be divide by zero');
end;
0 comments:
Post a Comment