Oracle Database 11g: Program with PL/SQL — Question 52
Which two statements correctly differentiate functions and procedures? (Choose two.)
Answer options
- A. A function can be called only as part of a SQL statement, whereas a procedure can be called only as a PL/SQL statement.
- B. A function must return a value to the calling environment, whereas a procedure can return zero or more values to its calling environment.
- C. A function can be called as part of a SQL statement or PL/SQL expression, whereas a procedure can be called only as a PL/SQL statement.
- D. A function may return one or more values to the calling environment, whereas a procedure must return a single value to its calling environment.
Correct answer: B, C
Explanation
The correct answer is B and C because a function is designed to return a value, while a procedure can return none or multiple values. Additionally, functions can be used in SQL statements, whereas procedures are limited to PL/SQL statements, which makes option A and D incorrect.