Stored subprograms, PL-SQL Programming

Stored Subprograms

Normally, tools (like Oracle Forms) which incorporate the PL/SQL engine can store subprograms locally for later, strictly local execution. Though, to become available for normal use, the subprograms should be stored in an Oracle database.

To create subprograms and store them everlastingly in an Oracle database, you can use the CREATE PROCEDURE and CREATE FUNCTION statements that you can execute interactively from the SQL Plus. For illustration, in the SQL Plus, you might create the procedure fire_employee, whih is as shown:

SQL> list

1 CREATE PROCEDURE fire_employee (emp_id NUMBER) AS

2 BEGIN

3 DELETE FROM emp WHERE empno = emp_id;

4* END;

SQL> /

Procedure created.

For the readability, at time creating the subprograms, you can use the keyword AS rather than IS in the specification.

Posted Date: 10/5/2012 5:27:44 AM | Location : United States







Related Discussions:- Stored subprograms, Assignment Help, Ask Question on Stored subprograms, Get Answer, Expert's Help, Stored subprograms Discussions

Write discussion on Stored subprograms
Your posts are moderated
Related Questions
Type versus Representation Confusion in SQL This describes how a value might have two or more distinct representations. For example, user-defined type POINT might have a decla

Understanding Varrays The Items of type VARRAY are termed as the varrays. They permit you to relate a single identifier with the whole collection. This relationship lets you man

Special cases of projection This section describes the identity projection, r {ALL BUT}, and the projection on no attributes, r { }, which yields TABLE_DUM when r is empty, ot

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean’s wants to create a trigger that automatically updates the stock level of all pr

Bulk Binds advantages In the Embedded Oracle RDBMS, the PL/SQL engines accept any valid PL/SQL subprogram or block. As the figure shows, the PL/SQL engine executes all procedur

Passing Cursor Parameters You use the OPEN statement to pass the parameters to a cursor. Unless you want to accept the default values, each proper parameter in the cursor decl

Use Object Types and Collections The Collection types and object types increase your efficiency by allowing for the realistic data modeling. The Complex real-world entities an

Effects of NULL The numeric variable X, perhaps of type INTEGER, might be assigned NULL. In that case the result of evaluating X + 1 is NULL, and so SET Y = X + 1 assigns NULL

Creating and Destroying Base Tables: Example shows an SQL command to create the base table counterpart of the ENROLMENT variable Example  Creating a base table. CREATE T

Packages The package is a schema object which groups logically associated to the PL/SQL items, types, and subprograms. The Packages have 2 sections: the specification & the bod