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

Home -> Community -> Mailing Lists -> Oracle-L -> order of rows when selecting from table of

order of rows when selecting from table of

From: Edgar Chupit <chupit_at_tsi.lv>
Date: Fri, 16 Apr 2004 07:33:31 +0300
Message-ID: <18444752937.20040416073331@tsi.lv>


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



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Thu Apr 15 2004 - 23:30:03 CDT

Original text of this message

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