Oracle Database 11g: Program with PL/SQL — Question 57
Identify two situations where the DBMS_SQL package should be used. (Choose two.)
Answer options
- A. The SELECT list is not known until run time.
- B. The dynamic SQL statement retrieves rows into records.
- C. You do not know how many columns a select statement will return, or what their data types will.
- D. You must use the % found SQL cursor attribute after issuing a dynamic SQL statement that is an insert or update statement.
Correct answer: A, C
Explanation
The correct answer options A and C refer to situations where the structure of the SQL query is not predetermined, making the DBMS_SQL package suitable for handling such dynamic cases. Option B does not specifically address the need for dynamic SQL execution, while option D relates to cursor attributes that are not exclusive to the dynamic SQL context.