Static Cursors v10
Rather than executing a whole query at once, it is possible to set up a cursor that encapsulates the query, and then read the query result set one row at a time. This allows the creation of SPL program logic that retrieves a row from the result set, does some processing on the data in that row, and then retrieves the next row and repeats the process.
Cursors are most often used in the context of a
WHILE loop. A conditional test should be included in the SPL logic that detects when the end of the result set has been reached so the program can exit the loop.
declaring_a_cursor opening_a_cursor fetching_rows_from_a_cursor closing_a_cursor using_%_rowtype_with_cursors cursor_attributes cursor_for_loop parameterized_cursors