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
Use External Routines The PL/SQL is particular for the SQL transaction processing. Therefore, several tasks are more quickly completed in a lower-level language like C that is

3CX PBX sync Windows Service Project Description: !! You require access to a commercial version of the 3CX PBX system in order to be able to program the API !! !! You requ

Write a pl/sql block that declares and uses cursors with parameters. In a loop, use a cursor to retrieve the department number and the department name from the departments table

Row Counterparts of Table Operators SQL does not have counterparts tuple rename, tuple projection, tuple extension, tuple join and tuple compose. To obtain the same effects as

Using Savepoints The scope of the savepoint is a transaction in which it is defined. The Savepoints defined in the major transaction are not related to the savepoints defined

SELECT INTO Statement   The SELECT INTO statement retrieve data from one or more database tables, and then assigns the selected values to the variables or fields. Syntax:

Existential Quantification - SQL Existential quantification-stating that something is true of at least one object under consideration-can be expressed by OR(r,c), meaning tha

The Package Specification The package specifications contain the public declarations. The scopes of these declarations are local to your database representation and global to t

Declaring Objects: You can use the object types wherever built-in types like CHAR or NUMBER can be used. In the block below, you can declare object r of type Rational. Then, yo

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