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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Getting cursor rowcount before fetching?

smonJan 24 2011 — edited Jan 26 2011
Just checking if this is do-able? Is there a way to find the total number of rows selected by a cursor after opening it, but before fetching anything?

I know the cursor attribute %rowcount returns the number of records fetched so far (although I don't see this as very useful if there's no way to first find out how many rows there are in total).

From what I've read in the docs it isn't possible, but just checking if anyone has found a way, or there's some deep, hidden, undocumented built-in somewhere that I can probe to get what I want. :o)

After the cursor is opened, the sql has been executed and the result set generated.. I don't see why Oracle couldn't report how many rows are in the result set before all the rows are fetched??

thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 23 2011
Added on Jan 24 2011
16 comments
14,543 views