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: Arrays

Re: Arrays

From: Kbat <kbatsche_at_yahoo.com>
Date: Tue, 7 Dec 1999 21:12:37 -0700
Message-ID: <82klm7$8vf$1@nnrp03.primenet.com>


PL/SQL version 2.3 or above can create multidimensional arrays - try

declare
type multi_array_def1 is table of type table_name%rowtype index by binary_integer;
v_array1 multi_array_def1;
--or
cursor c1 is

        select 'xxxxxxx' as label, count(rowid) as total1, count(rowid) as total2 from dual;
type multi_array_def2 is table of type c1 index by binary_integer; v_array2 multi_array_def2;

i number := 0;

begin
for x in c1

v_array(i).label := 'Just Testing';
v_array(i).total1 := x.total1;
v_array(i).total2 := x.total2;

i := i + 1;
end loop;

end;

...of course you may want to make your cursor do something more interesting than c1.
You cannot, however, create a new rowtype then use it in place of a table name.

Rajan Muthiah <rajan.muthiah_at_abbott.com> wrote in message news:384D61A3.96EE4163_at_abbott.com...
> No. PL/SQL has plsql table type for an one dimensional array. You can
> use two or more PL/SQL tables for an array, though.
> rajan
>
> amerar_at_ci.chi.il.us wrote:
>
> > Hello,
> >
> > Oracle PL/SQL has the capability for a one dimentional array such as
> > this:
> >
> > type myArray is table of VARCHAR2(10) index by binary_integer;
> > v_fielda myArray;
> >
> > Does it have the capability to do a two dimentional array?
> >
> > Arthur
> > amerar_at_ci.chi.il.us
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
>
Received on Tue Dec 07 1999 - 22:12:37 CST

Original text of this message

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