What is the difference between SENSITIVE and INSENSITIVE scrollable CURSOR with syntax


The INSENSITIVE SCROLLABLE CURSOR are sort of read only cursors in which the result table cannot change once the cursor is opened. The other applications also cannot update the INSENSITIVE SCROLLABLE CURSOR once it is opened. The SENSITIVE SCROLLABLE CURSOR, unlike INSENSITIVE are sensitive to changes made in the result table. The changes made by other applications will be reflected in the result table.

We can declare SENSITIVE and INSENSITIVE SCROLLABLE CURSOR like below.

EXEC SQL
      DECLARE ORDER_CURR SENSITIVE SCROLL CURSOR FOR
         SELECT ORDER_ID, ORDER_DATE FROM ORDERS
            WHERE ORDER_DATE = ‘2020-07-29’
END-SQL
EXEC SQL
      DECLARE ORDER_CURR INSENSITIVE SCROLL CURSOR FOR
         SELECT ORDER_ID, ORDER_DATE FROM ORDERS
            WHERE ORDER_DATE = ‘2020-07-29’
END-SQL

Updated on: 15-Sep-2020

931 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements