Home arrow Oracle arrow Page 4 - Oracle Stored Procedures

Create a procedure - Oracle

So what's this business with Oracle allowing programmers to put programs in databases? That's right. They're called Oracle stored procedures, and they're quite useful. Mooh the Cow walks you through writing, creating, debugging, and deleting a procedure.

TABLE OF CONTENTS:
  1. Oracle Stored Procedures
  2. Before you start
  3. Write a procedure
  4. Create a procedure
  5. Run a procedure
  6. Change a procedure
  7. Debug a procedure
  8. Drop a procedure
  9. What you have learned
  10. Further reading
By: Mooh The Cow
Rating: starstarstarstarstar / 879
January 03, 2005

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

The SQL statement CREATE OR REPLACE PROCEDURE creates, compiles and saves a procedure on an Oracle database.

You need the CREATE PROCEDURE system privilege to create a procedure in your own schema.

Open SQL*Plus from Windows and log on to your database.

From SQL*Plus, open your skeleton.sql file.
 
SQL*Plus loads the contents of your skeleton.sql file into the SQL*Plus buffer or memory area and presents the SQL*Plus command prompt:

  1  CREATE OR REPLACE PROCEDURE skeleton
  2  IS
  3  BEGIN
  4    NULL;
  5* END;
SQL>

Execute the contents of the SQL*Plus buffer. Type a front slash and press <enter> like this:

SQL> /

SQL*Plus informs you the procedure has been created successfully and presents the SQL command prompt:

Procedure created.

SQL>

Now your procedure is created, compiled and saved on your Oracle database.

We have a procedure now, so let's run it. 
 



 
 
>>> More Oracle Articles          >>> More By Mooh the Cow
 

blog comments powered by Disqus
   

ORACLE ARTICLES

- Oracle Releases Communications Network Integ...
- Oracle Releases Communications Data Model 11...
- Oracle Releases PeopleSoft PeopleTools 8.52
- Oracle Integrates Cloudera Apache Distro, My...
- Oracle Releases MySQL 5.5.18
- Oracle Announces NoSQL Database Availability
- Sorting Database Columns With the SELECT Sta...
- Retrieving Table Data with the LIKE Operator
- Using the IN and BETWEEN Operators on Tables
- Clauses and Logical Operators for Retrieving...
- Limiting Rows When Retrieving Table Data
- Using Scalar Functions for Retrieving Data
- Retrieving Data with String and Arithmatic E...
- Coding the SELECT Statement
- Oracle Releases iPad Virtual Desktop and Exa...


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap

Dev Shed Tutorial Topics: