Oracle Database: Advanced PL/SQL — Question 2
Which three are true about functions and procedures? (Choose three.)
Answer options
- A. The ACCESSIBLE BY clause can be used only for procedures.
- B. In a function, every execution path must lead to a RETURN statement.
- C. Both can have only constants as actual parameters for IN mode parameters.
- D. Both can be invoked from within SQL statements.
- E. In a procedure the RETURN statement cannot specify an expression.
- F. In a function every RETURN statement must specify an expression.
Correct answer: B, E, F
Explanation
Option B is correct because a function requires that all execution paths lead to a RETURN statement to return a value. Option E is true as procedures do not allow expressions in RETURN statements; they simply end execution. Option F is accurate since functions must return a value, hence every RETURN statement must specify an expression. Options A, C, and D are not correct as they contain inaccuracies regarding the usage of clauses and parameters.