Home » SQL & PL/SQL » SQL & PL/SQL » Counting rows
Counting rows [message #225115] Sat, 17 March 2007 16:57 Go to next message
Messages: 2
Registered: March 2007
Junior Member
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:


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


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

[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
Messages: 25571
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.


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: 1642
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
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: How to get either of two records?
Next Topic: Taking Input from console and Displaying Message using DBMS_OUTPUT.PUT_LINE
Goto Forum:

Current Time: Sun Aug 20 04:59:49 CDT 2017

Total time taken to generate the page: 0.00841 seconds