using rownum as index-counter of nested table or varray - Mailing list pgsql-sql

From Damonte Natalia
Subject using rownum as index-counter of nested table or varray
Date
Msg-id F64C06IxnqkVQQTD1T700007824@hotmail.com
Whole thread Raw
List 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 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



pgsql-sql by date:

Previous
From: Ricardo Javier Aranibar León
Date:
Subject: ...
Next
From: Dmitry Tkach
Date:
Subject: Re: Table Copy.