Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Programming » Using SQL in Applications » SQL Anywhere cursors

Cursor sensitivity example: A deleted row Next Page

Cursor sensitivity example: An updated row


This example uses a simple query to illustrate how different cursor types respond to a row in the result set being updated in such a way as to change the order of the result set.

Consider the following sequence of events:

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

    SELECT EmployeeID, Surname
    FROM Employees
    EmployeeID Surname
    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 updates the employee ID of employee 102 (Whitney) to 165 and commits the change.

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

No warnings or errors in bulk operations mode

Update warning and error conditions do not occur in bulk operations mode (-b database server option).