Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Help on Stored procedures(Urgent)

Re: Help on Stored procedures(Urgent)

From: Michael Bialik <michael_bialik_at_my-deja.com>
Date: 2000/06/10
Message-ID: <8hu6kc$7r1$1@nnrp1.deja.com>#1/1

Hi.

 Use PACKAGE to do it:

 CREATE or REPLACE PACKAGE xxx IS

   TYPE vtab_type IS TABLE OF VARCHAR2(64)

        INDEX BY BINARY_INTEGER;    PROCEDURE my_proc ( parm1 IN ..., out_tab OUT vtab_type );

 END xxx;

 CREATE OR REPLACE PACKAGE BODY xxx IS

  PROCEDURE my_proc ( ....., out_tab OUT vtab_type ) IS    ...
   i BINARY_INTEGER;
  BEGIN
   ...
   FOR i IN 1..2000 LOOP
     out_tab(i) := 'AAAA';
   END LOOP;
  END my_proc;

  END xxx;

  To cal the procedure from PL/SQL

  DECLARE
    my_tab xxx.vtab_type;
    ...
  BEGIN
    ...
    xxx.my_proc ( ..., my_tab );
    FOR i IN my_tab.first..my_tab.last LOOP       ...
    END LOOP;
  END;  HTH. Michael

In article <394279C4.B47BFD41_at_india.hp.com>,   "Ramesh S." <rameshs_at_india.hp.com> wrote:
> I want to know whether we can declare an array of varchar(64), as
 an
> out parameter in a stored procedure. if yes, how should i do it. what
 is
> the syntax for declaring such a stored procedure parameter and how
 will
> i load or get values from that array.
>
> The requirement is to return a list of strings, dates, numbers(out
> parameters) from a stored procedure, which can be retrieved as Array
> objects through JDBC from java.
>
> i am new to PL/SQL and stored procedures. please mail me if u have
> the answer.
>
> thanks in advance
> ramesh
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Sat Jun 10 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US