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
Keyword and Parameter Description: table_reference: This specifies a table or view that should be accessible when you execute the DELETE statement, and for that you must

Using Aggregation on Nested Tables Example is the most direct translation of its counterpart in the theory book that can be obtained in SQL but it is so over-elaborate that no

Assigning and Comparing Collections One collection can be assigned to other by an SELECT, INSERT, UPDATE, or FETCH statement, an assignment statement, or by a subprogram call. A

Effects of NULL for UNIQUE Specification When a UNIQUE specification u for base table t includes a column c that is not subject to a NOT NULL constraint, the appearance of sev

Natural Join - SQL In the absence of NATURAL JOIN Example has to be replaced by something rather more longwinded, as shown in Example. Example: Joining IS_CALLED and IS_EN

Exception handling In the PL/SQL, a warning or error condition is known as an exception. The Exceptions can be internally defined (by the run-time system) or user defined. The

ROWNUM The ROWNUM returns a number representing the order in which a row was selected from the table. The first row selected has a ROWNUM of 1; the second row has a ROWNUM of

Example of NOT EXISTS in SQL Example: Use of NOT EXISTS CREATE ASSERTION Must_be_enrolled_to_take_exam_alternative1 CHECK ( NOT EXISTS (SELECT StudentId, CourseId

LONG and LONG RAW You use the LONG datatype to store the variable-length character strings. The LONG datatype is such as the VARCHAR2 datatype, except that the maximum length o

Control Structures The Control structures are the most important PL/SQL extension to the SQL. Not only does PL/SQL let you manipulate Oracle data, it lets you process the data