I want to know how to go through all the tuples that are stored in a table; how do I do this in PL / SQL Oracle ?
Thank you in advance!
I want to know how to go through all the tuples that are stored in a table; how do I do this in PL / SQL Oracle ?
Thank you in advance!
I understand that you want to use a cursor . In PL/SQL
you can do using FOR
.
Suppose you have a table with the Code and Name fields, an example would look like this:
FOR i IN (SELECT Codigo, Nome FROM Tabela)
LOOP
/*Aqui é possível ler cada campo da tupla usando a variável "i"*/
DBMS_OUTPUT.PUT_LINE(i.Codigo||' '||i.Nome);
END LOOP;