Cursor lifecycle
- Declare a cursor.
- Associate with a query.
- If there are variables in the query, bind them.
- Open the cursor.
- Fetch rows.
- Close the cursor (possibly by consuming all rows).
Example
- account_cursor cursor for select * from account: Create a cursor over the result of the query.
- The query is not evaluated yet.
- for acct in account_cursor: Iterate over
the query result associated with the cursor.