What is the syntax for creating a package body?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

What is the syntax for creating a package body?

Rating:

Following is the syntax for creating a package body:

CREATE [OR REPLACE] PACKAGE BODY package_name
IS | AS
private type and item declarations
subprogram bodies
END package_name;


where,

  • OR REPLACE option specifies that if the package body already exists, it will be dropped and replaced with the new version created by the statement.

  • private type and item declarations represent variables, constants, cursors, exceptions, or types. Variables defined solely in the package body are private constructs. These are not visible outside the package body. All private constructs must be declared before they can be used in public constructs.

  • subprogram bodies define the public and private PL/SQL subprograms.


  • Note: The order in which subprograms are defined within the package body is important. A variable must be declared before it can be referred by another variable or subprogram. Private subprograms must be declared or defined before they can be called from other subprograms. It is a common practice to define all private variables and subprograms first and define public subprograms last in a package body.


    Rating:



    Other articles

    Click here to Article home

     
    uCertify.com | Our Company | Articles | Privacy | Security | Contact Us | News and Press Release | uCertify India
    MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
    Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
    © 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.