Give an example of a transaction program that contains a cursor, such that the value returned by one of its FETCH statements depends on whether or not the cursor was de?ned to be INSENSITIVE. Assume that this transaction is the only one executing. We are not concerned about any e?ect that a concurrently executing transaction might have.
What will be an ideal response?
```
EXEC SQL DECLARE GetEnrolled INSENSITIVE CURSOR FOR
SELECT T.StudId, T.Grade
FROM Transcript T
WHERE T.CrsCode = :crs_code
AND T.Semester = :semester;
EXEC SQL OPEN GetEnrolled;
INSERT INTO Transcript
VALUES (’656565656’, ’CS315’, ’F1997’, ’C’);
EXEC SQL FETCH GetEnrolled INTO :stud_id, :grade;
EXEC SQL CLOSE GetEnrolled;
```
Since the cursor is INSENSITIVE, it does not see the e?ect of the INSERT. If it were not INSENSITIVE, it could see the e?ect.
You might also like to view...
Referring to the picture above, which callout points to a group?
A. B B. C C. D D. E
A portion of code that performs a specific task and returns a value is known as a(n)
a) variable b) method c) operand d) identifier
The CSS Properties tab in the ____ pane can be clicked to display the CSS formatting options.
A. Tag Properties B. Formatting Properties C. Tab Properties D. Image Properties
Cell A2 contains the regular price $100. Cell B2 contains the discount rate 15%. Cell C3 contains =A2*(1-B2) to calculate the sale price of $85. Which of the following formulas produces the same result?
What will be an ideal response?