to avoid ORA-01476: divisor is equal to zero
declare
n1 number := 155;
n2 number := 0;
begin
n1 := n1/n2; -- divide by zero
dbms_output.put_line(n1);
exception
when ZERO_DIVIDE
then dbms_output.put_line('You Divided by Zero');
end;
/
Search This Blog
Total Pageviews
Saturday, 15 October 2011
Subscribe to:
Post Comments (Atom)
Oracle DBA
anuj blog Archive
- ▼ 2011 (362)
No comments:
Post a Comment