Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Does two dimensional arrays exist in PL/SQL?
Hello all and thanks Thomas and Ed,
The solution presented below by Ed continues to impress me.
Regards Steinar.
prochak_at_my-dejanews.com wrote:
> In article <3692cab6.2408523_at_192.86.155.100>,
> tkyte_at_us.oracle.com wrote:
> > A copy of this was sent to Steinar Orset <steinar_at_quasar.no>
> > (if that email address didn't require changing)
> > On Mon, 04 Jan 1999 10:43:09 +0100, you wrote:
> >
> > >Hello all procedure experts,
> > >I would like to work on two-dimesional arrays in PL/SQL. Is there a
> > >possibility for that in the
> > >following (or any other Oracle ) system: Personal Oracle7 Release
> > >7.3.3.0.0 and PL/SQL Release 2.3.3.0.0 ?
> > >
> >
> > Sort of. Its not really a 2 dimensional array but you can have tables of
> > records. For example:
> >
> > SQL> declare
> > 2 type myArray is table of emp%rowtype index by binary_integer;
> > 3
> > 3 empArray myArray;
> > 4 begin
> > 5 empArray(1).ename := 'Smith';
> > 6 empArray(1).empno := 1345;
> > 7 end;
> > 8 /
> >
> > PL/SQL procedure successfully completed.
> >
> > SQL>
> >
> > So, you don't access empArray(1,1) := 'Smith' but rather empArray(1).ENAME :=
> > 'Smith'....
> >
> > >I work on one-dimesional arrays fine like:
> > >
> > >TYPE myarray IS table OF integer INDEX BY BINARY_INTEGER;
> > >
> > >k BINARY_INTEGER :=0;
> > >
> > >person_id myarray;
> > >
> > > person_id(k):= some_number;
> > >
> > >
> > >Thanks for any help.
> > >
> > >Steinar.
> >
> > Thomas Kyte
> > tkyte_at_us.oracle.com
> > Oracle Service Industries
> > Reston, VA USA
> >
> > --
> > http://govt.us.oracle.com/ -- downloadable utilities
> >
>
>> ----- 440-498-3702
> ----- INDEX2D
> ----- GIVEN THE INDICES IN A 2-DIMENSIONAL ARRAY.
> ----- THIS RETURNS A UNIQUE INDEX IN A LINEAR ARRAY.
> -----
> ----- Ed Prochak
> ----- Magic Interface, Ltd.
>
>
>
>
>
>
>
>
>
>Received on Fri Jan 08 1999 - 02:41:59 CST
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
![]() |
![]() |