Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9055A475EBB for ; Thu, 19 Sep 2002 17:04:56 -0400 (EDT) Received: from hotmail.com (f64.law9.hotmail.com [64.4.9.64]) by postgresql.org (Postfix) with ESMTP id EFD25475EA9 for ; Thu, 19 Sep 2002 17:04:55 -0400 (EDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 19 Sep 2002 14:04:57 -0700 Received: from 160.33.98.117 by lw9fd.law9.hotmail.msn.com with HTTP; Thu, 19 Sep 2002 21:04:56 GMT X-Originating-IP: [160.33.98.117] From: "Damonte Natalia" To: pgsql-sql@postgresql.org Subject: using rownum as index-counter of nested table or varray Date: Thu, 19 Sep 2002 18:04:56 -0300 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 19 Sep 2002 21:04:57.0512 (UTC) FILETIME=[35A68280:01C26020] X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/228 X-Sequence-Number: 9505 Hi, In Oracle 8.1.7, I have a problem using rownum as an index-counter of nested table(or varray). I got a "ORA-06532: Subscript outside of limit" for the following code, although rownum is in the correct range. I saw an example to solve this problem, but I haven't got any succesfully result. For this example put a clause at where statement was enough. The clause is "where rownum < varray.count", but It didnīt work it for me. The nested table is defined as a type. V_PERIOD_PLUS_LT TYPE_PERIOD_PLUS_LT_OBJECT := TYPE_PERIOD_PLUS_LT_OBJECT('','',0,0,0); V_PERIOD_PLUS_LT_TABLE TYPE_PERIOD_LT_TABLE := TYPE_PERIOD_LT_TABLE(); Then I fill this table: for i in 1..10 loop V_PERIOD_PLUS_LT := TYPE_PERIOD_PLUS_LT_OBJECT('compania', 'producto', 2002, 9, 16); V_PERIOD_PLUS_LT_TABLE.EXTEND; V_PERIOD_PLUS_LT_TABLE(I) := V_PERIOD_PLUS_LT; end loop; Here I open the cursor using a rownum to access the table created before. open p_cursor for select V_PERIOD_PLUS_LT_TABLE(rownum).kyear year from product_master where rownum < 10; Is it really working at Oracle 8.17? Thanks _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com