Where should you declare this variable?

The add_player, upd_player_stat, and upd_pitcher_stat procedures are grouped together in a
package. A variable must be shared among only these procedures.
Where should you declare this variable?

The add_player, upd_player_stat, and upd_pitcher_stat procedures are grouped together in a
package. A variable must be shared among only these procedures.
Where should you declare this variable?

A.
In the package body.

B.
In a database trigger.

C.
In the package specification.

D.
In each procedure’s DECLARE section, using the exact same name in each.

Explanation:
A You want to declare this variable in the package body before the procedures so that it may be
shared among all of the procedure. If it was declared in the package specification it would be
accessible outside of the package.
Incorrect Answers:
B: If you declared it inside a trigger it could only be used by the trigger in which it was defined.C.
Declaring the variable in the package specification would make this variable public.D. The variable
would be local to each procedure and this would prevent the variable from being shared.



Leave a Reply 0

Your email address will not be published. Required fields are marked *