the_ratio number;
lower_limit constant number:=1.72;
cursor c is
select empno,nvl(comm,0) comm from emp;
begin
-- open c /* not required */
for x in c loop
begin
the_ratio:=(x.empno/x.comm);
if the_ratio>lower_limit then
dbms_output.put_line('the ratio>lower limit:'||to_char(the_ratio));
else
dbms_output.put_line('the ratio
exception
when zero_divide then
dbms_output.put_line('error zero divide');
end;
end loop;
end;
No comments:
Post a Comment