Oracle Database 11g: Program with PL/SQL — Question 44
Identify situations in which the DBMS_SQL package is the only applicable method of processing dynamic SQL. (Choose all that apply.)
Answer options
- A. When a query returns multiple rows
- B. When a column name in a where clause is unknown at compile time
- C. When the number of columns selected in a query is not known until run time
- D. When a table needs to be created based on an existing table structure at run time
- E. When privileges need to be granted to a new user to access an existing schema at run time
Correct answer: B, C
Explanation
The correct answers are B and C because the DBMS_SQL package is specifically designed to handle scenarios where the structure of SQL statements is not fully known at compile time. Options A, D, and E do not require dynamic SQL processing through DBMS_SQL, as they can be handled using standard SQL or other methods.