RE: Simple PL/SQL output question

  • From: <Craig.Healey@xxxxxxxxxxx>
  • To: <oracledba.williams@xxxxxxxxx>
  • Date: Wed, 9 Mar 2011 17:45:13 +0100

SET SERVEROUTPUT ON
works fine with my TOAD (10.6.1.3)
and the script works fine run in SQL*Plus (10.2.0.3.0) from TOAD

(Oracle 10.2.0.4 on Solaris)

Craig

________________________________
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Dennis Williams
Sent: 09 March 2011 17:30
To: Michael Moore
Cc: oracle-l@xxxxxxxxxxxxx
Subject: Re: Simple PL/SQL output question

Thanks Mike. Here is an abbreviated version of my script.

SET ECHO OFF
SET VERIFY OFF
SET SERVEROUTPUT ON
DECLARE
-- local variables and cursors
BEGIN
-- PL/SQL code
      DBMS_OUTPUT.PUT('------------------------------------------');
      DBMS_OUTPUT.NEW_LINE;
      DBMS_OUTPUT.PUT_LINE('QH Source Lot ID = '||LotRec.AppID);
      DBMS_OUTPUT.PUT_LINE('QH State = '||LotRec.State);
END;
/
On Wed, Mar 9, 2011 at 10:21 AM, Michael Moore 
<michaeljmoore@xxxxxxxxx<mailto:michaeljmoore@xxxxxxxxx>> wrote:
It would help to SEE what you did.
Mike

On Wed, Mar 9, 2011 at 7:43 AM, Dennis Williams 
<oracledba.williams@xxxxxxxxx<mailto:oracledba.williams@xxxxxxxxx>> wrote:
List,

I recently wrote a SQL script containing a PL/SQL anonymous block. I used 
DBMS_OUTPUT to sent results to the screen. This worked fine when I copied and 
pasted the script into a SQL*Plus session. However, when I just hit "r" to 
rerun the script, I noticed that it produced no output. Later I passed this to 
a user who ran it using Toad and got no output. Can anybody tell me what 
(isn't) going on?

The reason I used PL/SQL in this manner is that I needed more logic than SQL 
itself could provide. In our environment, creating database objects requires a 
lot of red tape, but we have a read-only account that can be used to run 
queries or ad-hoc scripts.

Thanks,
Dennis Williams


-----------------------------------------------------------------
ATTENTION:
The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.

Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
-----------------------------------------------------------------

Other related posts: