Re: PL/SQL -- a mute?

From: <Lance.Humpert_at_mail.tju.edu>
Date: 1996/08/12
Message-ID: <177E19BB7.ASVLH_at_TJUVM.TJU.EDU>#1/1


Jonathan Lent writes:  

> Somebody please confirm this: PL/SQL has no way of getting output to the
> standard output device without using some other application to print the
> output. Having used Sybase's Transact SQL (although I don't particularly
> like Sybase), I'm a little floored that there aren't any basic output
> commands in PL/SQL. I know I could write a SQL*Plus script, but it seems a
> little kludgy. Any comments or advice?
 

Oracle provides the sys.dbms_output package, which contains a 'put_line' routine. If it's installed on your system, this should work for you.  

In your pl/sql program include the following:  

  set serveroutput on;  

Then, when you want to write something to standard output:  

  dbms_output.put_line('here is static text: ' || variable_value);  

The way I understand it, the dbms_output package writes its arguments to an internal buffer which is dumped to stdout when your program completes. If you're generating a lot of output this way, it is possible to overflow the buffer.  

  • Lance (I guess you could consider the dbms_output package "some other application"...)
Received on Mon Aug 12 1996 - 00:00:00 CEST

Original text of this message