Home » SQL & PL/SQL » SQL & PL/SQL » Counting results from a loop (merged 4)
Counting results from a loop (merged 4) [message #420004] Wed, 26 August 2009 08:53 Go to next message
GuestUser32
Messages: 26
Registered: August 2009
Junior Member
Hi

I have a for loop in my procedure.
How can I count the results from this loop?
I need to know how many records it went through.

Thanks

[Updated on: Wed, 26 August 2009 09:02] by Moderator

Report message to a moderator

Re: Counting results from a loop [message #420008 is a reply to message #420004] Wed, 26 August 2009 08:56 Go to previous messageGo to next message
BlackSwan
Messages: 25042
Registered: January 2009
Location: SoCal
Senior Member
>How can I count the results from this loop?
count := count+1;

You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Go to the URL above click the link "Posting Guidelines"
Go to the section labeled "Practice" & do as directed.
Re: Counting results from a loop [message #420011 is a reply to message #420004] Wed, 26 August 2009 08:58 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Add a counter.
You know "i := i + 1;"

Regards
Michel
Re: Counting results from a loop (merged 4) [message #420148 is a reply to message #420004] Thu, 27 August 2009 04:47 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
If you're looping through a cursor, you can use <cursor name>%ROWCOUNT
Previous Topic: Date
Next Topic: calling shell scripts form oracle
Goto Forum:
  


Current Time: Wed Dec 07 04:55:46 CST 2016

Total time taken to generate the page: 0.07719 seconds