Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> order of rows when selecting from table of
Hello oracle-l,
I have custom type that is "table of numbers", does Oracle guaranties that when I use select from table(var) I will receive result in order of indexes? If not, than how do I get not only the values but also indexes of elements?
Thank you in advance!
Code snippet below:
SQL> create type num as table of integer 2 /
Type created.
SQL> var result refcursor;
SQL> declare
2 n num := num();
3 begin
4 n.extend(10);
5 for i in 1 .. 10 loop
6 n(i) := i;
7 end loop;
8
9 open :result for select column_value from table ( n );
10 end;
11 /
PL/SQL procedure successfully completed.
SQL> print result;
COLUMN_VALUE
1 2 3 4 5 6 7 8 9 10
10 rows selected.
--
Edgar
![]() |
![]() |