Which two statements about functions are true?

Which two statements about functions are true? (Choose two.)

Which two statements about functions are true? (Choose two.)

A.
A function must have a return statement in its body to execute successfully

B.
Client-side functions can be used in SOL statements

C.
A stored function that is called from a SOL statement can return a value of any PL/SOL variable
data type

D.
From SOL*Plus, a function can be executed by giving the command EXECUTE functionname;

E.
A stored function increases efficiency of queries by performing functions on the server rather
than in the application

Explanation:
There should be a RETURN statement in the function body. If the RETURN statement in the
executable section is omitted, the function will successfully compile but the following error will be generated at
run time:
ORA-06503: PL/SQL: Function returned without value
This is because the function does not return any value to the calling block.
E: User-defined functions increase the efficiency of queries by applying the functions in the query
itself. This improves performance because the data will be filtered on the server as opposed to the
client which will reduce network traffic.
Incorrect Answers:
C: Functions called from SQL expressions should return the data type that is compatible with SQL.
PL\SQL Data Types such as BOOLEAN, RECORD, or TABLE data types are not supported by
SQL.D. Functions are not called like procedures. You cannot use EXECUTE to invoke a function
unless you have a variable to hold the returning value.



Leave a Reply 0

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