Suggested Pages

Sunday, July 22, 2012

PL/SQL Cursor loops


In this post i'll show a short snippet of code about loops with cursors in PL/SQL (Procedural Language/Structured Query Language) language.

A simple way to do a loop in PL/SQL language is to use cursors as shown below.

Cursor loop

for myrec in (select col1, col2 from table A)

loop
       /* here you can use myrec.col1 or myrec.col2 to access and manage fields */
end loop;


No comments :

Post a Comment

Suggested Pages