ASP.NET
  Home arrow ASP.NET arrow Oracle Database Interaction Using ODP.NET ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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? 
ASP.NET

Oracle Database Interaction Using ODP.NET and ASP.NET: Accessing Stored Procedures, Functions
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2005-11-03

    Table of Contents:
  • Oracle Database Interaction Using ODP.NET and ASP.NET: Accessing Stored Procedures, Functions
  • Accessing a simple PL/SQL procedure with OUT parameter using ODP.NET
  • What about IN OUT parameter in a PL/SQL procedure?
  • Accessing the IN OUT parameter using ODP.NET
  • A word about stored functions and about accessing them using ODP.NET

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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 Database Interaction Using ODP.NET and ASP.NET: Accessing Stored Procedures, Functions


    (Page 1 of 5 )

    This article is an extension to my previous article (Accessing P/SQL Stored Procedures). It mainly concentrates on the parameter directions of a PL/SQL stored procedure. It also deals with stored functions and packages.
    A downloadable file for this article is located here.

    The sample downloadable solution (zip) is entirely developed using Visual Studio.NET 2003 Enterprise Architect on Windows Server 2003 Standard Edition together with Oracle 10g (version 10.2).  But, I am confident that it would work with other versions of Windows (which support .NET 1.1) as well.

    A simple PL/SQL procedure with OUT parameter

    I already introduced the concepts of stored procedures and accessing them using ODP.NET in my previous article.  Now, I shall extend the same article with a few more features.  Even though I dealt with stored procedures in my previous article, they are a bit basic. 

    We didn’t focus much on “parameter direction types” in PL/SQL, which is a very important topic.  Even though this series mostly concentrates on ODP.NET, this topic is worth discussing here.  For a complete understanding of PL/SQL sub programs, I suggest you go through my very long series on “database interaction with PL/SQL” at www.devshed.com/bio/cp/jagadish-chatarji.

    Coming to our brief discussion of parameter direction types, let us first concentrate on the OUT parameter.  The simple PL/SQL procedure I created for demonstrating this example is as follows:

    PROCEDURE "SCOTT"."P_GETCOUNT" (
      "RECCOUNT" OUT NUMBER) IS

    BEGIN -- executable part starts here

           SELECT COUNT(*)
           INTO   RECCOUNT
           FROM   EMP;

    END "P_GETCOUNT";

    The above syntax would be a bit different if you are directly working with SQL*Plus or iSQL*Plus.  As I created the above from “Oracle Developer Tools for Visual Studio.NET”, the syntax would be a bit different.  But, overall, we can understand that the name of the stored procedure is “P_GETCOUNT” and it finds the number of employees available in the table EMP. 

    The most important issue to consider is the following parameter declaration:

      "RECCOUNT" OUT NUMBER

    The above declaration confirms that “RECCOUNT” is a parameter that could return a value (indirectly) back to the application.  In fact, it doesn’t accept any parameter at all as input. This means that passing a parameter value is not necessary any more.

    More ASP.NET Articles
    More By Jagadish Chaterjee


       · this is currently the last in the series. have a look and give me the feedback
     

    ASP.NET ARTICLES

    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ
    - Developing a Dice Game Using ASP.NET Futures...
    - Completing an ASP.NET AJAX Server-Centric Ba...
    - Information Management for an ASP.NET AJAX S...
    - Comment and Order Management for an ASP.NET ...
    - Back-end Management Tasks for an ASP.NET AJA...
    - User Information Management for an ASP.NET A...
    - Adding Comments and Search to an ASP.NET AJA...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway