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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Array in pl/sql??

Re: Array in pl/sql??

From: John Leggitt <johnml_at_istar.ca>
Date: 1998/03/31
Message-ID: <I7%T.69$U55.891165@NewsRead.Toronto.iSTAR.net>#1/1

There is a PL/SQL table that acts somewhat like a C array. You have to create a table type, then declare a variable of that type and assign values to indexed locations in the PL/SQL table variable. One can use table attributes to delete or get info about the table and of course you can access the values stored in it at various index locations. By making the table of a record type rather than a scalar (char, number, etc.) one can store more than one value at each index location which would be similar to a multi-dimensional array in C.

Another way would be to use a temporary database table and then use a for..loop cursor to step through the values in this table. This is much more powerful and easier although database access is necessary while the PL/SQL table just exists in memory for the scope of the PL/SQL block..

Good luck!
JohnL

Vorname Name wrote in message <01bd5bea$c82e8a10$b3080180_at_fe9227>...
> Is it possible to declare in pl/sql to something similar to
>array's of values in C Or is there some round about way of storing
>values and retriving these values one after another.
. Received on Tue Mar 31 1998 - 00:00:00 CST

Original text of this message

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