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 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
Explanation:
B and C ar the ans
B,C
only C
for (not B)
SQL> r
1 declare
2 x dual%rowtype;
3 col varchar2(30):=’DUMMY’;
4 begin
5 execute immediate ‘select * from dual where ‘||col||’=”X”’ into x;
6* end;
PL/SQL procedure successfully completed.
B,C
C
BC
why B,C ??
i can work B,C with “execute immediate”, not just with “DBMS_SQL”!!!
“DBMS_SQL” is “only applicable” if i need type of column and etc.