|
--Example of good select statment by using explicit cursor:
declare
v_dummy employees.id%type;
cursor cu_emps is
select id
from employees
where id = 1234;
begin
open cu_emps;
fetch cu_emps into v_dummy;
..
..
..
end;
--Example of bad select statement by using implicit cursor:
declare
v_emp_id varchar2;
begin
select id
into v_emp_id
from employees
where id = 1234;
..
..
..
exception
when no_data_found the
..
..
..
end;
|