Cursor for loops is a simple way to retrieves rows without using the open, fetch and close statements.
Cursor for loop implicitly declares the loop index as record which represents a row to be fetched from the cursor. Cursor for loop, opens the cursor, recursively fetches the row values from the cursor and then closes the cursor.
CURSOR emp_c IS
SELECT salary FROM employees;
FOR emp_rec IN emp_c LOOP
salary_total := salary_total + emp_rec.salary;