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: select from VARRAY - how to preserve order

Re: select from VARRAY - how to preserve order

From: andrewst <member14183_at_dbforums.com>
Date: Tue, 10 Jun 2003 19:07:00 +0000
Message-ID: <2986333.1055272020@dbforums.com>

Originally posted by Karsten Schmidt
> Hi there,
> this is on Oracle 9.2.0.3 64 Bit on HPUX 11.11
>
> I am trying to un-roll data that is stored in a simple varray.
> How do I ensure, the data is returned in the VARRAY order.
> This is to be used in various joins with other tables.
> The issue is that I don't know that to put into the 'order by'
> clause for my
> select statement.
> What I would need is something like 'order by bla, blubb,
> array-index'.
>

My understanding is that VARRAYs are inherently ordered, and so are "guaranteed" to appear ordered as they were created in any SELECT statement. Can't find where it explicitly says so in the docs though, other than in the definition: "An array is an ordered set of data elements".

However, I guess if you "unroll" the VARRAY in an inline view and then order the result, the fact that it was a VARRAY will get lost...? Not being inclined to use VARRAYs or nested tables, I couldn't say for sure.

--
Posted via http://dbforums.com
Received on Tue Jun 10 2003 - 14:07:00 CDT

Original text of this message

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