Intermediate
10-6. | Which of the following strings are valid cursor attributes (which means they are “attached” as a suffix to the name of the cursor)?
|
10-7. | 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';
|
10-8. | 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; ... |
Get Oracle PL/SQL Programming: A Developer's Workbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.