Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 11th, 2004, 07:41 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default arrays and stored procedure in oracle

Hi i have a stored procedure in oracle i want to pass an array to store procedure and process it , can any one help me how to do it.

  #2 (permalink)  
Old March 12th, 2004, 04:34 AM
aas aas is offline
Authorized User
 
Join Date: Mar 2004
Location: Moscow, , Russia.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to aas
Default

Hi, Munawwar

Simple example how to use array:

CREATE PACKAGE MyPkg IS

  TYPE MyType ( field1 number );
  TYPE MyArray IS TABLE OF MyType INDEX BY BINARY_INTEGER;

  PROCEDURE MyProc ( inArray in out MyArray );

END;

CREATE PACKAGE BODY MyPkg IS

  PROCEDURE MyProc ( inArray in out MyArray ) IS
  BEGIN
     ...
     your code
     ...
  END;

END;

Execute procedure MyProc:

DECLARE
  tmpArray MyPkg.MyType;
BEGIN
  FOR i IN 1..3 LOOP
    tmpArray( i ) := 1;
  END LOOP;
  MyPkg.MyProc( tmpArray );
END;

Also you can create type "MyType" as DB type...

Good luck!

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.net with oracle stored procedure vgsgowrisankar C# 2005 1 April 16th, 2008 03:14 PM
how to pass array to oracle stored procedure? zhao2007 Hibernate 1 March 21st, 2008 03:51 PM
Oracle Stored Procedure life.gurpreet C# 2005 0 March 13th, 2007 04:54 AM
Oracle Stored Procedure and Microsoft Query Raoul Oracle 0 January 23rd, 2006 03:41 AM
Calling an Oracle Stored Procedure booksnore2 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 October 1st, 2004 09:35 AM



All times are GMT -4. The time now is 08:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.