Home » SQL & PL/SQL » SQL & PL/SQL » Counting rows
Counting rows [message #225115] Sat, 17 March 2007 16:57 Go to next message
lala1
Messages: 2
Registered: March 2007
Junior Member
Hi,
I am trying to learn pl/sql and I need some help, please.
I have written a package with a cursor and a loop, which returns a file with some lines.
The last step I have to do is to write something that returns the number of lines produced in the file: i.e, if the loop retuns 356 lines, I have to write something that calculates that figure and returns the result in the last line.

I was told that I need to create a variable and place it somewhere at this point to do the calculation:

END LOOP;

Utl_File.Put(l_Output, 'end of file');

Utl_File.Fclose(l_Output);

I do not quite understand what to do or how to do it, can someone help?
Thanks

[Updated on: Sat, 17 March 2007 16:59]

Report message to a moderator

Re: Counting rows [message #225117 is a reply to message #225115] Sat, 17 March 2007 17:53 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
We (TINW) don't do homework assignments for folks.
You can find many fine coding examples at http://asktom.oracle.com
Or you could simply try using Google.

HTH & YMMV

P.S.
This is NOT an expert level question.

[Updated on: Sat, 17 March 2007 18:04] by Moderator

Report message to a moderator

Re: Counting rows [message #225174 is a reply to message #225115] Sun, 18 March 2007 17:32 Go to previous messageGo to next message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
Are you asking how to track the number of iterations made by a loop, or how to write a line to a file?
Re: Counting rows [message #225212 is a reply to message #225174] Mon, 19 March 2007 03:10 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I think he's asking how to declare a variable and store a number in it....
Previous Topic: Correct SQL?
Next Topic: 10g XE - Script Editor not behaving in Firefox ??
Goto Forum:
  


Current Time: Wed May 15 02:13:22 CDT 2024