Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DBMS_OUTPUT

1,220 views
Skip to first unread message

David_T MO

unread,
Sep 8, 2004, 11:34:28 AM9/8/04
to
I'm a long time SQL user but an Oracle newbie and have inherited an
Oracle database. I'm trying to get DBMS_OUTPUT going but am hitting a
brick wall. I can describe the package and execute the 'set
serveroutput on' command, but anytime I attempt to use any procedure
within the package I get an 'unknown command' error (see below).
Doesn't matter what user_id I use. I've rerun the dbmsotpt.sql as SYS
successfully but no joy on using the procedures.

Any suggestions on how to get DBMS_OUTPUT working?

---

limsd>describe dbms_output;
PROCEDURE DISABLE
PROCEDURE ENABLE
Argument Name Type In/Out
Default?
------------------------------ ----------------------- ------
--------
BUFFER_SIZE NUMBER(38) IN DEFAULT
PROCEDURE GET_LINE
Argument Name Type In/Out
Default?
------------------------------ ----------------------- ------
--------
LINE VARCHAR2 OUT
STATUS NUMBER(38) OUT
PROCEDURE GET_LINES
Argument Name Type In/Out
Default?
------------------------------ ----------------------- ------
--------
LINES TABLE OF VARCHAR2(255) OUT
NUMLINES NUMBER(38) IN/OUT
PROCEDURE NEW_LINE
PROCEDURE PUT
Argument Name Type In/Out
Default?
------------------------------ ----------------------- ------
--------
A VARCHAR2 IN
PROCEDURE PUT
Argument Name Type In/Out
Default?
------------------------------ ----------------------- ------
--------
A NUMBER IN
PROCEDURE PUT_LINE
Argument Name Type In/Out
Default?
------------------------------ ----------------------- ------
--------
A VARCHAR2 IN
PROCEDURE PUT_LINE
Argument Name Type In/Out
Default?
------------------------------ ----------------------- ------
--------
A NUMBER IN

limsd>SET SERVEROUTPUT ON;
limsd>DBMS_OUTPUT.ENABLE;
SP2-0734: unknown command beginning "DBMS_OUTPU..." - rest of line
ignored.

Michel Cadot

unread,
Sep 8, 2004, 12:14:59 PM9/8/04
to

"David_T MO" <david....@cityutilities.net> a écrit dans le message de
news:4f6c512c.04090...@posting.google.com...

The problem is not with the package.
The problem is how to execute a package or a PL/SQL statement.
Maybe looking at SQL*Plus Manual.
For instance:

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1009731

--
Regards
Michel Cadot

Mark C. Stock

unread,
Sep 8, 2004, 1:21:28 PM9/8/04
to

"Michel Cadot" <micadot{at}altern{dot}org> wrote in message
news:413f2f66$0$7594$636a...@news.free.fr...

|
| "David_T MO" <david....@cityutilities.net> a écrit dans le message de
| news:4f6c512c.04090...@posting.google.com...
...

>
| > limsd>SET SERVEROUTPUT ON;
| > limsd>DBMS_OUTPUT.ENABLE;
| > SP2-0734: unknown command beginning "DBMS_OUTPU..." - rest of line
| > ignored.
|
| The problem is not with the package.
| The problem is how to execute a package or a PL/SQL statement.
| Maybe looking at SQL*Plus Manual.
| For instance:
|
|
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1009731
|
| --
| Regards
| Michel Cadot
|
|
|

as the link indicates, use the SQL*Plus EXECUTE command (only works in
SQL*Plus) -- or use an anonymous block. simply wrap your PL/SQL fragment in
BEGIN ... END;

download the PL/SQL and SQL manuals from the referenced web site and google
'pl/sql tutorial' for more info

++ mcs


Thomas Jensen

unread,
Sep 8, 2004, 3:07:31 PM9/8/04
to


Hi,

using sql*plus you have use one of the following syntaxes:

SQL> execute dbms_output.put_line('Test executing statement');

or

SQL> begin
2 dbms_output.put_line('Test using PL/SQL');
3 end;
4 /


Best regards
Thomas Jensen


Daniel Morgan

unread,
Sep 8, 2004, 9:34:47 PM9/8/04
to

SQL> set serveroutput on
SQL> exec dbms_output.enable;

For a full demo go to http://www.psoug.org
Click on Morgan's Library
Click on DBMS_OUTPUT

--
Daniel A. Morgan
University of Washington
damo...@x.washington.edu
(replace 'x' with 'u' to respond)

David_T MO

unread,
Sep 10, 2004, 9:20:00 AM9/10/04
to
"Michel Cadot" <micadot{at}altern{dot}org> wrote in message news:<41408f08$0$15562$636a...@news.free.fr>...

> "David_T MO" <david....@cityutilities.net> a écrit dans le message de
> news:4f6c512c.04090...@posting.google.com...
> > Thanks guys, that did the trick.
> >
> > I'll do some more digging for tutorials, etc. from the sites given,
> > but I have another quick question. Why, when I execute this test SQL
> > script (below), am I getting the message 'Input truncated to 1
> > characters'?
>
> Add a new line at the end of the script.
> The message comes from that the last line is not ended (does not end with chr(10)).

Thanks!

0 new messages