Sanjay Thakur
Sanjay Thakur

Reputation: 285

How to get record count using reference cursor in oracle10g

I want to know how we can get record count using reference cursor in oracle10g.

Upvotes: 1

Views: 7925

Answers (2)

user119635
user119635

Reputation:

After you fetched the rows you can use cursorname%rowcount to get the amount of records you fetched.

Upvotes: 2

Thilo
Thilo

Reputation: 262534

You cannot.

You can only count the rows while you fetch them from the cursor.

A cursor is like a stream, and Oracle does not know how much rows are in there until it has read them all (which happens as you fetch rows).

Upvotes: 1

Related Questions