Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SERVEROUTPUT Status
> Syltrem wrote:
>
> > Hi Daniel
> >
> > Why do you (and others before) say that DBMS_OUTPUT does not belong to
> > production code?
> >
> > I have PL/SQL blocks that are executed in batch mode (for daily update etc)
> > and I output messages like:
> >
> > 6576 rows updated
> > 8765 rows inserted
> >
> > at the end of the run so that when I look at the log file I know it did what
> > I expected it to do. If it runs and no message is printed, how do I know for
> > sure that it actually did something?
Syltrem,
There is absolutely nothing wrong with using DBMS_OUTPUT in production code. It has its own limitations but if it still does what you need - just use it. The output is not transactional and it's usefull in the situations like yours. You can have output messages even if your pl/sql block rolled back a transaction.
Regards,
Igor
Daniel Morgan <damorgan_at_x.washington.edu> wrote in message news:<1076433043.938326_at_yasure>...
> We say it because DBMS_OUTPUT is likely the most abused of all built-in
> packages. Far better to create a table and output the information as an
> insert showing date of run, start time, end time, and rows processed.
> That way you have a permanent graphable record.
There are horses for courses. For the situations like Syltrem's your approach is an overkill. DBMS_OUTPUT works fine there with the additional advantage of non-transactional output.
> If no one is looking at the monitor 7x24 then DBMS_OUTPUT is not the
> tool of choice. A simple "clear screen" and your record is gone. What
> happens if the job fails? Record is gone. ...
Ever heard about output redirection and logfiles?
Regards,
Igor
Received on Tue Feb 10 2004 - 17:56:46 CST
![]() |
![]() |