1Z0-149 practice question 3 of 15

Which two PL/SQL elements can be deprecated using the DEPRECATE pragma? (Choose two.)

Full set: 65 questions
Answer options
A: PACKAGES Correct answer
B: VARIABLES Correct answer
C: ANONYMOUS BLOCK
D: TRIGGER BODY
E: DATABASE LINKS
Correct Answer:
A. PACKAGES; B. VARIABLES
Explanation

The PRAGMA DEPRECATE is a compiler directive that issues a warning when code referencing a deprecated element is compiled. According to Oracle's documentation, this pragma can be applied to a standalone subprogram, a package specification, an object type specification, or specific elements within them. Therefore, an entire PACKAGE can be deprecated. The pragma can also be applied to a CONSTANT declaration within a package. While the option "VARIABLES" is broad, a constant is a form of named data object, making this the only other plausible choice among the options provided, as the other elements listed cannot be deprecated.

Why Incorrect

C. Anonymous blocks are not named, stored program units and cannot be referenced from other code; thus, deprecation is not applicable.
D. The DEPRECATE pragma is not applicable to a trigger's declaration or its body. Triggers are managed differently.
E. Database links are schema objects for remote database access, not PL/SQL elements to which a compiler pragma can be applied.

References

- Oracle Database, PL/SQL Language Reference, 19c, "DEPRECATE Pragma". This section explicitly lists the syntax and valid locations for the pragma, which include packagedeclaration and constantdeclarationinpackage.

- Oracle Database, PL/SQL Language Reference, 12c Release 2 (12.2), "DEPRECATE Pragma". The documentation confirms that the pragma applies to packages and constants within packages, but not to general variables, triggers, or database links.

Scroll to Top