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!

Row Count of a REF CURSOR

FlakeNov 26 2007 — edited Nov 26 2007
Consider the following PL/SQL:

TYPE ref_cursor IS REF CURSOR;
l_row_count NUMBER := 0;
l_cursor ref_cursor;

OPEN l_cursor FOR 'SELECT * FROM user_tables';
l_row_count := l_cursor%ROWCOUNT;

Will "l_row_count" contain the number of row in "l_cursor"? I tried a simple procedure.
Though it is not returning any error, the row count is shown as "0" though there were
rows in the table. Or am I doing incorrectly? Suggests are welcome.
Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 24 2007
Added on Nov 26 2007
8 comments
1,510 views