Comparison of scrollable cursors
Whether a scrollable cursor can view the changes that are made to the data by other processes or cursors depends on how the cursor is declared. It also depends on the type of fetch operation that is executed.
When you declare a cursor as SENSITIVE STATIC, changes that other processes or cursors make to the underlying table can be visible to the result table of the cursor. Whether those changes are visible depends on whether you specify SENSITIVE or INSENSITIVE when you execute FETCH statements with the cursor. When you specify FETCH INSENSITIVE, changes that other processes or other cursors make to the underlying table are not visible in the result table. When you specify FETCH SENSITIVE, changes that other processes or cursors make to the underlying table are visible in the result table.
When you declare a cursor as SENSITIVE DYNAMIC, changes that other processes or cursors make to the underlying table are visible to the result table after the changes are committed.
The following table summarizes the sensitivity values and their effects on the result table of a scrollable cursor.
DECLARE sensitivity | FETCH INSENSITIVE | FETCH SENSITIVE |
---|---|---|
INSENSITIVE | No changes to the underlying table are visible in the result table. Positioned UPDATE and DELETE statements using the cursor are not allowed. | Not valid. |
SENSITIVE STATIC | Only positioned updates and deletes that are made by the cursor are visible in the result table. | All updates and deletes are visible in the result table. Inserts made by other processes are not visible in the result table. |
SENSITIVE DYNAMIC | Not valid. | All committed changes are visible in the result table, including updates, deletes, inserts, and changes in the order of the rows. |