Link to home
Start Free TrialLog in
Avatar of stummj
stummjFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Pro*c cursor rowcount

Is there any way of telling how many rows there are in a declared cursor BEFORE fetching the data?
A colleague suggested that there may be an attribute of SQLCA which will give me that but they have gone home and I can find no reference for SQLCA or how to use it!

Anyone got any ideas? The alternative would just be to do a count(*) of the SELECT statement, but I shouldnt have to!

Julian
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stummj

ASKER

rowcount gives the number of rows selected even before the fetch? Are you sure?!
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Am I sure of what?  I'm confused.......(which is really nothing new)....

>> "I know that rowcount for a cursor provides the number of rows processed."

ie. after the fetch
ishando:  Thanks for the clarification (I thought that was implied.....it's kind of hard to process a row that hasn't been fetched)
Avatar of stummj

ASKER

Thanks for trying but thats not what I asked.
I want to know if there is a way once you have the declaration whether you can determine how many rows in the select.
Not without doing the fetch - your alternative of doing a count would be the way to get this info
Avatar of stummj

ASKER

Isnt there an attribute of the cursor itself? How is space reserved? I would have thought that once the cursor is declared, some space is reserved for it?