Oracle Database: Advanced PL/SQL — Question 56
Which two are true about packages? (Choose two.)
Answer options
- A. Variables and cursors defined in a package specification are visible to all subprograms in the same schema that has the package.
- B. Modifications to a packaged procedure's body automatically cause recompilation of subprograms that invoke the procedure.
- C. Package specifications can be compiled without their bodies.
- D. Standalone subprograms that reference a package can be compiled only after both the package specification and body are compiled.
- E. A package definition must have a specification and body.
Correct answer: A, C
Explanation
Option A is correct because variables and cursors in the package specification are indeed accessible to all subprograms in the same schema. Option C is also correct as package specifications can be compiled on their own, independent of the body. The other options are incorrect as they either misstate the relationship between packages and their components or the compilation requirements.