Oracle Database 11g: Program with PL/SQL — Question 1
Which two tasks should be created as functions instead of as procedures? (Choose two.)
Answer options
- A. Reference host or bind variables in a PL/SQL block of code
- B. Tasks that compute and return multiple values to the calling environment
- C. Tasks that compute a value that must be returned to the calling environment
- D. Tasks performed in SQL that increase data independence by processing complex data analysis within the Oracle server, rather than by retrieving the data into
Correct answer: C, D
Explanation
The correct answers are C and D because functions are designed to compute and return a single value, making them suitable for tasks that yield a specific value to the calling environment. Option B is incorrect as functions typically return one value, and option A does not pertain to the differentiation between functions and procedures.