Procedures - syntax, PL-SQL Programming

Procedures

The procedure is a subprogram which can take parameters and be invoked. Normally, you can use a procedure to perform an action. The procedure has 2 sections: the specification & the body.

The specification starts with the keyword PROCEDURE and ends with the procedure name or a parameter list. The Parameter declarations are not obligatory. The Procedures that take no parameters are written without the parentheses. The procedure body starts with the keyword IS and ends with the keyword END followed by an elective procedure name.

The procedure body has 3 sections: an optional declarative section, an executable section, & an optional exception-handling section. The declarative section consists of declarations of the types, constants, cursors, variables, exceptions, &subprograms. These items are local and cease to exist whenever you exit the procedure. The executable section consists of statements which assign the values, manipulate Oracle data, and control execution. The exception-handling section contains the exception handlers that deal with the exceptions raised during execution.

Syntax:

621_procedures syntax.png

 

382_procedures syntax1.png

Posted Date: 10/8/2012 7:29:53 AM | Location : United States







Related Discussions:- Procedures - syntax, Assignment Help, Ask Question on Procedures - syntax, Get Answer, Expert's Help, Procedures - syntax Discussions

Write discussion on Procedures - syntax
Your posts are moderated
Related Questions
Multiple Assignment- SQL SQL supports multiple assignment to local variables and also applies multiple assignment semantics in SET clauses of UPDATE statements, but does not

Parameter and Keyword Description: dynamic_string: This is a string variable, literal, or expression which represents a SQL statement or the PL/SQL block. define_vari

Name Resolution   During the compilation, the PL/SQL compiler relates identifiers like the name of a variable with an address or memory location, actual value, or datatype. Th

ORIGIN OF EARTH - BIG-BAN G HYPOTHESIS - Origin of life is linked to origin of earth. Cosmos, the Universe originated 10-20 billion years ago by Big Bang (thermonu

Deleting Objects You can use the DELETE statement to eradicate objects from an object table. To eradicate objects selectively, you use the WHERE clause, as shown below: BEG

Predefined Exceptions The internal exception is raised implicitly whenever your PL/SQL program exceeds a system-dependent limit or violates an Oracle rule. Each & every Oracle

Product-specific Packages The Oracle and different Oracle tools are supplied with the product-specific packages which help you to build the PL/SQL-based applications. For illu

Main features of PL/SQL A good way to get familiar with PL/SQL is to look at a sample program. The below program processes an order for tennis rackets. At first, it declares a

Advantages of Invoker Rights The Invoker-rights routines centralize the data retrieval. They are particularly helpful in applications which store data in various schemas. In su

Substitution and Instantiation - SQL It shows how NULL might appear in substitution for a parameter of a predicate and how it might thus participate in instantiation of that p