From: Damonte Natalia <nataliadamonte@hotmail.com>
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
Message-ID: <F64C06IxnqkVQQTD1T700007824@hotmail.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: nataliadamonte@hotmail.com
Subject: Re: using rownum as index-counter of nested table or varray
In-Reply-To: <F64C06IxnqkVQQTD1T700007824@hotmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox