Private versus Public Items Assignment Help

Assignment Help: >> Package Body - Private versus Public Items

Private versus Public Items:

Let consider the subsequent example:

CREATE OR REPLACE PACKAGE TESTVAR AS X NUMBER:=0;

END;

Look again at the package sord. The package body declares a variable named X that is initialized to zero. Unlike items declared in the specification of SORD the items declared in the body are restricted to use within the package. Thus, PL/SQL code outside the package cannot reference the function chkqty. Like as items are termed private.

Therefore, items declared in the specification of testvar such as the variable x are visible outside the package. Thus, any PL/SQL code can reference the variable x. like as items are termed public.

When items are to be maintained they must be during a session or across transactions and placed in the declarative part of the package body. In the package specification if the items are to be made public.

Note: When a packaged subprogram remotely then the overall package is reinstantiated and its previous state is lost.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd