SunQuest
 
       Oracle
  Home arrow Oracle arrow Page 5 - Database Interaction with PL/SQL, Work...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
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

Database Interaction with PL/SQL, Working with TABLE in Sub-programs, Parameter Modes
By: Jagadish Chatarji
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 19
    2005-08-30

    Table of Contents:
  • Database Interaction with PL/SQL, Working with TABLE in Sub-programs, Parameter Modes
  • Returning PL/SQL TABLE from a FUNCTION to a PROCEDURE
  • What are IN types of parameters?
  • What are OUT types of parameters?
  • What is an IN OUT type of parameter?

  • 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

    At the virtual BlackBerry Technical Seminar 2008, you can ask your development questions directly of Research In Motion® (RIM) experts, and take advantage of learning opportunities designed uniquely for BlackBerry solution developers. Register Today!

    Database Interaction with PL/SQL, Working with TABLE in Sub-programs, Parameter Modes - What is an IN OUT type of parameter?


    (Page 5 of 5 )

    The IN OUT type of parameter is special type of parameter which can be accessed and modified.  Both operations can be done using an IN OUT parameter.  We can rewrite the above program as follows with the concept of an IN OUT parameter:

    declare

       b          number := 10;
       
    procedure doSquare(z IN OUT number) is
       
    begin

          z := z * z;

       end;

    begin

        doSquare(b);
       
    dbms_output.put_line('Square : ' || b);
    end;

    /

    The above program is completely different from all of the earlier programs.  Let us examine the life of the variable of ‘b’ in the above program.  We can conclude something like the following:

    ‘b’ is declared as of type number.

    ‘b’ is immediately initialized to 10.

    ‘doSquare’ method is called by passing the value of ‘b’ (which is 10 at this moment).

    ‘z’ receives 10 (which has got permission for both access and modify).

    ‘z’ gets updated to ‘z * z’ (which is 100 at this moment).

    As ‘z’ got modified, automatically ‘b’ in main program gets modified (at this moment ‘b’ is 100 as well).

    We are displaying back the value in ‘b’, which is 100.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Hello guys, this is my article on working with sub-programs with tables in PL/SQL....
     

       

    ORACLE ARTICLES

    - 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...
    - Sub-templates and More with Oracle HTML DB
    - Focusing on Templates in Oracle HTML DB





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