Cursor FOR loop is a shortcut to use explicit cursors. It does not require explicit opening, fetching, and closing of the cursor. In other words, the cursor FOR loop implicitly opens the cursor, fetches the record, and closes the cursor. In the cursor FOR loop, the cursor is defined and its attributes are checked within the processing of the FOR loop. The records are also implicitly defined within the loop, as shown in the following code:
Cursor em P_cursor IS
Select emp_code. emp_name. emp_salary from t_employeeS;
FOR emp_record IN em p_cursor
v_increment emp_record.emp_salary • 0.20
(emp_FREOFthent_COOR 11 'Ilemp_record.emp_name II " II v_increment);
It is also possible to use a cursor FOR loop with a subquery, where the cursor name is not defined. In this case, the attributes of the cursor cannot be checked as no explicit cursor name is defined.