What is the syntax for creating a procedure?

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 procedure?

Rating:

Following is the syntax for creating a procedure:

CREATE [OR REPLACE] PROCEDURE procedure_name
[(parameter [mode] datatype, parameter [mode] datatype, ......)]
IS | AS
PL/SQL block;


where,

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

  • procedure_name specifies the name of the procedure.

  • parameter specifies the name of a PL/SQL variable whose value is passed to or populated (or both) by the calling environment depending on the parameter mode being used. The size of a parameter's datatype cannot be restricted, i.e., a length or precision cannot be specified for the datatype of the parameter.

  • mode specifies the parameter mode (IN (default), OUT, or IN OUT).

  • datatype specifies the datatype of the parameter. It can be any SQL or PL/SQL datatype. It can be of %TYPE, %ROWTYPE, or any scalar or composite datatype.

  • PL/SQL block is the procedural body that defines the action performed by the procedure. It starts with either BEGIN or the declaration of local variables and ends with either END or END procedure_name.

  • 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.