Which two statements are true about the above function?

Examine the following code:

Which two statements are true about the above function? (Choose two.)

Examine the following code:

Which two statements are true about the above function? (Choose two.)

A.
It can be used only in a parallelized query.

B.
It can be used in both a parallelized query and a parallelized DML statement.

C.
It can be used only in a parallelized data manipulation language (DML) statement.

D.
It can have a separate copy run in each of the multiple processes when called from a SQL
statement that is run in parallel.

E.
It requires a PRAGMA RESTRICT_REFERENCES declaration with RNDS, WNDS, RNPS, and
WNPS specified in order to use parallel optimization.

Explanation:



Leave a Reply 12

Your email address will not be published. Required fields are marked *


Leonid

Leonid

I think the answers are “B” and “D”.
Because documentation (http://docs.oracle.com/cd/E11882_01/server.112/e25523/parallel003.htm#VLDBG1473) says “ANY of the following cases” and we already have PARALLEL_ENABLE keyword:

In a SELECT statement or a subquery in a DML or DDL statement, a user-written function may be executed in parallel in any of the following cases:

– If it has been declared with the PARALLEL_ENABLE keyword

– If it is declared in a package or type and has a PRAGMA RESTRICT_REFERENCES clause that indicates all of WNDS, RNPS, and WNPS

– If it is declared with CREATE FUNCTION and the system can analyze the body of the PL/SQL code and determine that the code neither writes to the database nor reads or modifies package variables

Jyoti

Jyoti

Ans is B and D for sure

samkelo siyabonga ngubo

samkelo siyabonga ngubo

B,D

samkelo siyabonga ngubo

samkelo siyabonga ngubo

B,E

Piero

Piero

in my opinion
B
but D is wrong since the function is not defined in a package or type (not visible to the ssytem), it’s created by CREATE FUNCTION STATEMENT, so it’s visible and the system analyze it

Functions in Parallel DML and DDL Statements
In a parallel DML or DDL statement, as in a parallel query, a user-written function may be executed in parallel in any of the following cases:
• If it has been declared with the PARALLEL_ENABLE keyword
• If it is declared in a package or type and has a PRAGMA RESTRICT_REFERENCES clause that indicates all of RNDS, WNDS, RNPS, and WNPS
• If it is declared with the CREATE FUNCTION statement and the system can analyze the body of the PL/SQL code and determine that the code neither reads nor writes to the database or reads or modifies package variables

Piero

Piero

sorry, i ment …. A is right and E is worng , not D

may be D is correct because question ask two answer and D seems the best.
I don’t know if it’s right
anyone can explain why D is right better ?
thanks and sorry

Piero

Piero

OK today it seems that i’m mad, a little mad…
i repeat
i meant B and D should be correct
about D, please, someone can telle me if really
it can have a separate copy run in each of the multiple processes when called from a sql statement that is runin parallel

Uladzimir

Uladzimir

B, D

E is incorrect.
Restricted reference is for PACKAGED subprogramms only and it is deprecated