Which of the following strings are valid cursor attributes (which means they are “attached” as a suffix to the name of the cursor)?
Which of the following uses of cursor attributes are valid? If they are not valid, what is the problem? Assume that the following cursor is declared in the same block when referenced in the problems:
CURSOR possibly_in_danger_cur IS SELECT status FROM genetically_modified_foods WHERE product = 'CORN' AND animal = 'MONARCH BUTTERFLY';
What is wrong with the following code? Will you eventually run out of open cursors in the session if you execute this program, say, 100,000 times?
CREATE OR REPLACE FUNCTION totalsales (year_in IN INTEGER) RETURN NUMBER IS CURSOR sales_cur IS SELECT SUM (amt) FROM ...; total NUMBER; BEGIN OPEN sales_cur; FETCH sales_cur INTO total; RETURN total; CLOSE sales_cur; ...