Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dbms_output.put_line

Status
Not open for further replies.

CHUMPY

Programmer
Oct 8, 2002
37
GB
I have a package that is essentially a tool that performs a number of operations on a schema. Within this package I use the dbms_output.put_line function write back to the user the progress of the operations.

The problem is the output only appears when the whole procedure has finshed, not very good at informing the user of the progress of the tasks!

Is there anyway of forcing the dbms_output.put_line command to write back when the line is encountered rather than when the procedure is completed?

Thanks

Gareth
 
No. You should learn about how it works. Briefly, dbms_output doesn't print anything to your screen but rather places some data to a temporary buffer. Then, when the whole procedure is finished this buffere is read by calling application (sql*plus in your case I suppose) and its content is printed. To read intermediate results you may either split your work on smaller pieces or trace the process from another session (e.g. via pipe)

Regards, Dima
 
Chumpy,

(This is basically my same response as on your Oracle 8i thread). When I need to do either progress reporting or error isolation in PL/SQL, I use PL/SQL's "utl_file" package to write to a flat text file. Are you familiar with how to use that package (which opens, reads, writes, appends, and closes flat files per your needs)? If not, repost and Carp, Sem, and many others can give you some help/examples.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 17:15 (04Feb04) GMT, 10:15 (04Feb04) Mountain Time)
 
Hi,

Thanks for the help, I have used the utl_file package, I was just after a very simple way to give feedback to the users as each task finshed and the next started. i.e. Updating xxxx records etc rather than them sitting there with a blank screen.

I kind if guessed that it worked like Sem said but just thought I would ask on the off chance!

Thanks for your time

Chumpy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top