Oracle
  Home arrow Oracle arrow Page 3 - Oracle Stored Procedures
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ORACLE

Oracle Stored Procedures
By: Mooh The Cow
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 662
    2005-01-03


    Table of Contents:
  • Oracle Stored Procedures
  • Before you start
  • Write a procedure
  • Create a procedure
  • Run a procedure
  • Change a procedure
  • Debug a procedure
  • Drop a procedure
  • What you have learned
  • Further reading

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Oracle Stored Procedures - Write a procedure
    ( Page 3 of 10 )

    Procedures are written in Oracle's PL/SQL programming language.

    Let’s write a harmless procedure that does nothing, so we can compile and run it with no fear of damage to your database.

    In Notepad, type:

    CREATE OR REPLACE PROCEDURE skeleton
    IS
    BEGIN
      NULL;
    END;

    Save your file as skeleton.sql.

    Let’s go through the procedure line by line. The lines are numbered for your convenience:

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

    Line 1:

    CREATE OR REPLACE PROCEDURE is an SQL statement that instructs Oracle to create a procedure called skeleton, and to overwrite it if it exists.

    Line 2:

    The IS keyword signals that a PL/SQL body will follow.

    Line 3:

    The BEGIN keyword signals the start of a PL/SQL body.

    Line 4:

    The NULL PL/SQL statement indicates that no action should be performed. We cannot just leave it out, because at least one statement is required in a PL/SQL body.

    Line 5:

    The END keyword signals the end of the PL/SQL block.

    Now let's move on to creating a procedure.
     



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

       

    ORACLE ARTICLES

    - Oracle's Turn to Play in the Sun
    - Implementing and Using Oracle`s Restore Poin...
    - Tuning PL/SQL Code
    - Debugging PL/SQL Code
    - Testing PL/SQL Code
    - Working With PL/SQL Code
    - Conditional Compilation for Oracle Database ...
    - Compile-Time Warnings for Oracle DB 10g
    - Compiling PL/SQL Code for an Oracle Database
    - Troubleshooting PL/SQL Code
    - Managing PL/SQL Code
    - Data Manipulation and More for HTML DB Appli...
    - Oracle Database Fundamentals
    - Adding Processes to HTML DB Applications
    - Adding Computations, Processes, and Validati...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    Stay green...Green IT