CURSORES EN ORACLE
WHILE LOOP
declare
cursor c_clientes is
select * from clientes;
registro_clientes c_clientes%rowtype;
begin
open c_clientes;
fetch c_clientes into registro_clientes;
while c_clientes%FOUND loop
DBMS_OUTPUT.put_line('EL cliente es: ' || registro_clientes.nombre_cliente);
fetch c_clientes into registro_clientes;
end loop;
close c_clientes;
end;LOOP – EXIT WHEN (DO WHILE)
declare
cursor c_clientes is
select * from clientes;
registro_clientes c_clientes%rowtype;
begin
open c_clientes;
loop
fetch c_clientes into registro_clientes;
EXIT WHEN c_clientes%NOTFOUND;
DBMS_OUTPUT.put_line('EL cliente es: ' || registro_clientes.nombre_cliente);
end loop;
close c_clientes;
end;
FOR
declare
cursorc_clientes is
select * from clientes;
begin
for i in c_clientes loop
DBMS_OUTPUT.put_line('EL cliente es: ' || i.nombre_cliente);
end loop;
end;
CURSORES
WHILE LOOP
declare
cursor c_clientes is
select * from clientes;
registro_clientes c_clientes%rowtype;
begin
open c_clientes;
fetch c_clientes into registro_clientes;
while c_clientes%FOUND loopDBMS_OUTPUT.put_line('EL cliente es: ' || registro_clientes.nombre_cliente);
fetch c_clientes into registro_clientes;
end loop;
close c_clientes;
end;
LOOP – EXIT WHEN (DO WHILE)
declare
cursor c_clientes is
select * from clientes;
registro_clientes c_clientes%rowtype;
begin
open c_clientes;
loop
fetch c_clientes into registro_clientes;
EXIT WHENc_clientes%NOTFOUND;
DBMS_OUTPUT.put_line('EL cliente es: ' || registro_clientes.nombre_cliente);
end loop;
close c_clientes;
end;
FOR
declare
cursor c_clientes is
select * from clientes;
begin
for i in c_clientes loop
DBMS_OUTPUT.put_line('EL cliente es: ' || i.nombre_cliente);
end loop;
end;
CURSORES
WHILE LOOP
declare
cursor c_clientes is
select * fromclientes;
registro_clientes c_clientes%rowtype;
begin
open c_clientes;
fetch c_clientes into registro_clientes;
while c_clientes%FOUND loop
DBMS_OUTPUT.put_line('EL cliente es: ' || registro_clientes.nombre_cliente);
fetch c_clientes into registro_clientes;
end loop;
close c_clientes;
end;
LOOP – EXIT WHEN (DO WHILE)
declare
cursor c_clientes is
select *from clientes;
registro_clientes c_clientes%rowtype;
begin
open c_clientes;
loop
fetch c_clientes into registro_clientes;
EXIT WHEN c_clientes%NOTFOUND;
DBMS_OUTPUT.put_line('EL cliente es: ' || registro_clientes.nombre_cliente);
end loop;
close c_clientes;
end;
FOR
declare
cursor c_clientes is
select * from clientes;
begin
for i in c_clientesloop
DBMS_OUTPUT.put_line('EL cliente es: ' || i.nombre_cliente);
end loop;
end;
CURSORES
WHILE LOOP
declare
cursor c_clientes is
select * from clientes;
registro_clientes c_clientes%rowtype;
begin
open c_clientes;
fetch c_clientes into registro_clientes;
while c_clientes%FOUND loop
DBMS_OUTPUT.put_line('EL cliente es: ' || registro_clientes.nombre_cliente);fetch c_clientes into registro_clientes;
end loop;
close c_clientes;
end;
LOOP – EXIT WHEN (DO WHILE)
declare
cursor c_clientes is
select * from clientes;
registro_clientes c_clientes%rowtype;
begin
open c_clientes;
loop
fetch c_clientes into registro_clientes;
EXIT WHEN c_clientes%NOTFOUND;
DBMS_OUTPUT.put_line('EL cliente es: ' ||registro_clientes.nombre_cliente);
end loop;
close c_clientes;
end;
FOR
declare
cursor c_clientes is
select * from clientes;
begin
for i in c_clientes loop
DBMS_OUTPUT.put_line('EL cliente es: ' || i.nombre_cliente);
end loop;
end;
CURSORES
WHILE LOOP
declare
cursor c_clientes is
select * from clientes;
registro_clientes c_clientes%rowtype;
begin
open...
Regístrate para leer el documento completo.