dbTalk Databases Forums  

number of rows in cursor?

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss number of rows in cursor? in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
tojo
 
Posts: n/a

Default Re: number of rows in cursor? - 12-13-2004 , 03:26 AM






In article <8ghud.637251$mD.2711@attbi_s02>, kennedy-
downwithspammersfamily (AT) attbi (DOT) net says...
Quote:
"Frank Piron" <empty (AT) zero (DOT) nil> wrote in message
newspsisl5wh3m0et4w (AT) news (DOT) online.de...
Am Fri, 10 Dec 2004 09:45:50 +0100 schrieb eudorica
snjezana.katusic (AT) htnet (DOT) hr>:

Is there way to count a number of rows in opened cursor before fetching
it
(%rowcount works only after fetching)? I need to know the number of rows
before enter loop. Thanks.



You may count the rows explicitly before entering the loop.

if the cursor statement is: select <projection-clause
from ....

you may count with: select count(rowid) into <counter_var
from ....

where <counter_var> is some local variable into which you may
store the number of rows the cursor will retrieve.

--
Frank Piron,
defrankatkonaddot
(leftrotate two)
Except the number could change from count to the fetch of the data.
Jim



You could surround the whole thing with "SET TRANSACTION READ ONLY" and
"COMMIT". Results should then be the same regardless of other sessions.

-- Tom


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.