PL/SQL. CURSORES
-- 1--
declare
cursor cursor4 is
select p.sopln_codigo
from sisact_solicitud_plan p
where p.planc_codigo in ('E97');
solinCodigo varchar2(50);
begin
open cursor4;
fetch cursor4
into solinCodigo;
dbms_output.put_line(solinCodigo);
close cursor4;
end;
--
--2--
declare
cursor cursor4 is
select p.sopln_codigo
from sisact_solicitud_plan p
where p.planc_codigo in ('E97');
solinCodigo varchar2(50);
begin
open cursor4;
loop
fetch cursor4
into solinCodigo;
exit when cursor4%notfound;
dbms_output.put_line(solinCodigo);
end loop;
close cursor4;
end;
--3--
declare
cursor cursor4 is
select p.sopln_codigo
from sisact_solicitud_plan p
where p.planc_codigo in ('E97');
solinCodigo varchar2(50);
begin
open cursor4;
fetch cursor4
into solinCodigo;
dbms_output.put_line(solinCodigo);
close cursor4;
end;
--
--2--
declare
cursor cursor4 is
select p.sopln_codigo
from sisact_solicitud_plan p
where p.planc_codigo in ('E97');
solinCodigo varchar2(50);
begin
open cursor4;
loop
fetch cursor4
into solinCodigo;
exit when cursor4%notfound;
dbms_output.put_line(solinCodigo);
end loop;
close cursor4;
end;
--3--
Comentarios
Publicar un comentario