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: arrays in pl/sql

Re: arrays in pl/sql

From: Dan Richards <dan_at_eurographics.co.uk>
Date: Tue, 01 Jun 1999 14:28:32 +0100
Message-ID: <3753E000.21D7F49C@eurographics.co.uk>


Hi

You can use PL/SQL tables as follows:

define a table type:

   TYPE my_array_type IS TABLE OF VARCHAR2(50) INDEX BY BINARY_INTEGER;

define your variable:

    my_array my_array_type;

refer to each cell as follows:

    my_array(i) := 'value';

Each cell will be 50 characters, but you must refer to the cell using a long integer index number (+/- 2^32).
The April 99 edition of Oracle Developer from Pinnacle showed a set of functions for mimicking two and three dimensional arrays based on splitting a single PL/SQL table into two 2^16 sections, so the low values become your "x" values, and high ones become "y"... Very clever!

Dan

Martin Lynch wrote:

> folks
>
> is it possible to declare an array of a type in pl/sql. i have a record
> type defined and i would like to delare >1 instance of it with the same
> name. is this possible?
>
> my record type is called - rec_type
>
> and i would like to define it as follows
>
> myrecords[5] rec_type; - 5 will be substituted by a variable eventually
>
> is this possible or am i going totally the wrong way about this.....
> and if anyone could point me in the right direction it would be appreciated
>
> thanks in advance
> marty
Received on Tue Jun 01 1999 - 08:28:32 CDT

Original text of this message

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