PL/SQL identifiers declared in an enclosing unit are available to its subunits. If a subunit redeclares an identifier, the local declaration hides the enclosing one unless the enclosing identifier is qualified with its declaring unit's name. Thus, the initialized procedure variable in A is accessed as calc_price.price, and B's procedure uses the enclosing initialized variable. In C and D, the value sent to DBMS_OUTPUT is NULL rather than zero.
Community Discussion