Contents Index Cursor sensitivity overview Cursor sensitivity example: an updated row

ASA Programming Guide
  Using SQL in Applications
    Adaptive Server Anywhere cursors

Cursor sensitivity example: a deleted row


This example uses a simple query to illustrate how different cursors respond to a row in the result set being deleted.

Consider the following sequence of events:

  1. An application opens a cursor on the following query against the sample database.

    SELECT emp_id, emp_lname
    FROM employee
    ORDER BY emp_id
    emp_id emp_lname
    102 Whitney
    105 Cobb
    160 Breault
    ... ...
  2. The application fetches the first row through the cursor (102).

  3. The application fetches the next row through the cursor (105).

  4. A separate transaction deletes employee 102 (Whitney) and commits the change.

The results of cursor actions in this situation depend on the cursor sensitivity:


Contents Index Cursor sensitivity overview Cursor sensitivity example: an updated row