1Z0-052 · Question #81
Which two statements are true regarding a PL/SQL package body? (Choose two.)
The correct answer is A. It cannot be created without a package specification. D. It can be changed and recompiled without making the package specification invalid. A PL/SQL package body depends on a specification to exist and can be recompiled independently without affecting the spec's validity.
Question
Which two statements are true regarding a PL/SQL package body? (Choose two.)
Options
- AIt cannot be created without a package specification.
- BIt cannot invoke subprograms defined in other packages.
- CIt can contain only the subprograms defined in the package specification.
- DIt can be changed and recompiled without making the package specification invalid.
How the community answered
(57 responses)- A91% (52)
- B2% (1)
- C7% (4)
Why each option
A PL/SQL package body depends on a specification to exist and can be recompiled independently without affecting the spec's validity.
A package body cannot exist without a corresponding package specification because the spec defines the public interface that the body is required to implement. Oracle enforces this dependency at creation time.
This is false - a package body can freely call subprograms defined in other packages, which is one of the primary purposes of the package construct in PL/SQL.
This is false - a package body can also contain private subprograms that are not declared in the specification, making them accessible only within the body itself.
The package body can be modified and recompiled without invalidating the package specification, because the spec is a separate, independently compiled object. Dependent objects only become invalid when the specification itself changes.
Concept tested: PL/SQL package body structure and recompilation rules
Source: https://docs.oracle.com/en/database/oracle/oracle-database/19/lnpls/CREATE-PACKAGE-BODY-statement.html
Topics
Community Discussion
No community discussion yet for this question.