Oracle: Read Table

REM set server output to ON to display output from DBMS_OUTPUT
SET SERVEROUTPUT ON

DECLARE
CURSOR Cur1 IS
select * from HR.COUNTRIES;
Rec1 Cur1%rowtype;
BEGIN

FOR someone IN (SELECT * FROM hr.employees WHERE employee_id < 120 )
LOOP
DBMS_OUTPUT.PUT_LINE(‘Nome = ‘ || someone.first_name ||
‘, Cognome = ‘ || someone.last_name);
END LOOP;
open Cur1;
— FOR j IN 1..100 LOOP — Analizza i primi 100 elementi
LOOP
FETCH Cur1 INTO Rec1;
exit when Cur1%notfound;
DBMS_OUTPUT.PUT_LINE(‘Paese:’||Rec1.country_name);

end loop;

close Cur1;
end;

 

Both comments and pings are currently closed.

Comments are closed.