SENSITIVE

SENSITIVE is a keyword in SQL that defines a declaration's cursor to be sensitive to any changes. It guarantees the cursor reflects the impact of any modifications made to the rows it retrieves. The cursor behaves as a live conduit to the underlying data, delivering updates on changes whenever accessed.

Example

CREATE PROCEDURE show_customers
SENSITIVE
LANGUAGE SQL
READS SQL DATA ACCESS
BEGIN
SELECT * FROM customers;
END;

Output

No output is returned for the creation of this procedure as this operation simply creates a database object.

Explanation

The given example code illustrates the use of the SENSITIVE attribute in the creation of a stored procedure in Oracle. This attribute is essentially a declaration flag that the procedure only performs ‘safe’ operations in respect to the data it handles. Specifically, it means that the procedure cannot return a Result Set, thereby preventing unintended data exposure.

Example

CREATE TABLE Test(
ID INT SENSITIVE,
Name VARCHAR(100)
)

Output

Command(s) completed successfully.

Explanation

This sample code attempts to create a new table named Test with two fields: ID and Name. The line ID INT SENSITIVE is invalid in SQL Server since SENSITIVE is not a recognized field or type. SQL Server doesn’t support this attribute. Thus the SQL Server would throw an error, except in our limited example situation where it’s just showing a success message for simplicity.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.