Identify two situations where the DBMS_SQL package should be used. (Choose two.)
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.
A C
a c
A and C
A and C
C, D are wrong because:
You MUST use NDS (native dynamic SQL) instead of DBMS_SQL package when:
1. the dynamic SQL stmt needs to retrieve rows into records
2. there is need to use the SQL cursor attribute %FOUND, %ISOPEN, %NOTFOUND, %ROWCOUNT, after issuing a dynamic SQL stmt that is a DML or single row stmt.
Could you please give an example of point 1.
AC
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.
source: https://dl.dropboxusercontent.com/u/2831271/Oracle/study-guide-for-1z0-144_-oracle-morris-matthew.pdf
—-
So B and D are false, wich leaves A and C as the correct answer.
AC