Oracle Database 11g: Program with PL/SQL — Question 49
What is the correct definition of the persistent state of a packaged variable?
Answer options
- A. It is a private variable defined in a procedure or function within a package body whose value is consistent within a user session.
- B. It is a public variable in a package specification whose value is consistent within a user session.
- C. It is a private variable in a package body whose value is consistent across all current active sessions.
- D. It is a public variable in a package specification whose value is always consistent across all current active sessions.
Correct answer: B
Explanation
The correct answer is B because a persistent state in a package variable refers specifically to a public variable defined in the package specification, which retains its value throughout the user session. Options A and C refer to private variables, which do not maintain their state across sessions, while option D incorrectly describes the variable as always consistent across all sessions, which is not the case for session-specific state.