Identify situations in which the DBMS_SQL package is the only applicable method of processing
dynamic SQL. (Choose all that apply.)
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 ofcolumns 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
B C
B, c
c
b , c
changed opinion
From the documentation:
—-
The DBMS_SQL package can also be used to generate dynamic SQL in PL/SQL. In
most situations, NDS is easier to implement and performs better than DBMS_SQL.
However, there are limitations to Native Dynamic SQL that sometimes require the
use of DBMS SQL. In particular, there is no support in NDS for dynamic SQL
statements that have an unknown number of inputs or outputs. In addition, there are
some tasks that can only be performed using DBMS_SQL.
In certain situations, you must use native dynamic SQL instead of the DBMS_SQL
package:
– The dynamic SQL statement needs to retrieves rows into records.
– There is a need to use the SQL cursor attribute %FOUND, %ISOPEN, %NOTFOUND, or %ROWCOUNT after issuing a dynamic SQL statement that is an INSERT, UPDATE, DELETE, or single-row SELECT statement.
So answer should be: A, C
Sorry I was wrong. A is not correct, I must say only C is correct although I find it very strange to have only one option in a multi choice question.
So if I have to chose more that one let it be B and C.
B C
B C
Guys, be careful. You must choose more than one option here.
Look at this:
http://www.aiotestking.com/oracle/identify-situations-in-which-the-dbms_sql-package-is-the-only-applicable-method-of-processing-dynamic-sql-choose-all-that-apply/#comment-481777
BC