using rownum as index-counter of nested table or varray

From: "Damonte Natalia" <nataliadamonte(at)hotmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: using rownum as index-counter of nested table or varray
Date: 2002-09-19 21:04:56
Message-ID: F64C06IxnqkVQQTD1T700007824@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 didnt 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

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitry Tkach 2002-09-19 22:48:16 Re: Table Copy.
Previous Message Ricardo Javier Aranibar León 2002-09-19 20:30:29