Re: Simple PL/SQL output question

From: Michael Moore <michaeljmoore_at_gmail.com>
Date: Wed, 9 Mar 2011 09:44:03 -0800
Message-ID: <AANLkTinz-8OaZJYq4iAXqwt9ShHZhK2=6VwVDrSkXvZC_at_mail.gmail.com>



Hi Dennis,
Actually I meant show us the entire run like:

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 9 09:40:47 2011

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> set serveroutput on
SQL> select * from dual;
SP2-0640: Not connected
SQL> connect ops$mmoore
Enter password: ********
ERROR:
ORA-12560: TNS:protocol adapter error

SQL> Frankly, I'm not familiar with the R command. Perhaps Niall is on the right track.

Regards.
Mike

On Wed, Mar 9, 2011 at 8:29 AM, Dennis Williams < oracledba.williams_at_gmail.com> wrote:

> 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_at_gmail.com>wrote:
>
>> It would help to SEE what you did.
>> Mike
>>
>>
>> On Wed, Mar 9, 2011 at 7:43 AM, Dennis Williams <
>> oracledba.williams_at_gmail.com> 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
>>>
>>
>>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Mar 09 2011 - 11:44:03 CST

Original text of this message