Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to declare a %rowtype of a dynamic cursor?

658611Mar 29 2011 — edited Mar 29 2011
Hi guys

I need to declare a rowtype variable of a dynamic cursor. Is this possible??
The porpouse of this is to store this rows into a pl/sql table.

Example:

DECLARE
T_CURSOR IS REF CURSOR
MY_C IS T_CURSOR;
MY_RT IS MY_C%ROWTYPE;
TYPE MY_TABLE IS TABLE OF MY_RT INDEX BY BYNARI_INTEGER;

BEGIN
OPEN MY_C FOR 'SELECT * FROM MYTABLE';
FETCH MY_C INTO MY_TABLE(1);
FETCH MY_C INTO MY_TABLE(2);
FETCH MY_C INTO MY_TABLE(3);
FETCH MY_C INTO ...........
END;

Obviously this don“t work, but do somebody know how can I do something for to obtain the same result??

Thanks
This post has been answered by Solomon Yakobson on Mar 29 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 26 2011
Added on Mar 29 2011
5 comments
1,909 views