Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2004, 07:41 PM
Registered User
 
Join Date: Mar 2004
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.

 
Old March 12th, 2004, 04:34 AM
aas aas is offline
Authorized User
 
Join Date: Mar 2004
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!






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





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