-
How can I set serveroutput on in a stored procedure? When I try it, I get:
PLS-00103: Encountered the symbol "SERVEROUTPUT" when expecting
one of the following:
transaction
Oracle DBA and Developer
-
dbms_output.enable (1000000);
Jeff Hunter
-
Is there any reason this wouldn't work in Personal Oracle. I'm messing around with it here at home, and it doesn't work.
SQL>exec dbms_output.enable(100000);
PL/SQL procedure successfully completed.
SQL>exec dbms_output.put_line('Hi there!');
PL/SQL procedure successfully completed.
SQL>set serveroutput on
SQL>exec dbms_output.put_line('Hi there!');
Hi there!
Hi there!
It seems that the output was buffered, but it wasn't flushed until I set serveroutput on.
Now what?
Oracle DBA and Developer
-
It´s NOT a personal Oracle issue here, but a general one. The ENABLE procedure turn the BUFFER on, but sql*plus can´t "see" it´s on by itself, the setting needed to do it is the SET serveroutput on.
Note : ANY setting in sql*plus environment (linesize, screen echo, page size in screen, etc) MUST be done using a sql*plus command called SET (or using the menu, in GUI mode), and PL/SQL don´t understand sql*plus commands (SET or whatever - PL/SQL just "knows" PL and SQL commands). SO, the environment must be ready BEFORE the PL/SQL runs : you can do it in a PL/SQL script BEFORE the PL/SQL block, OR automagically habilit put the sql*plus commands in the login/glogin script.
Regards,
Chiappa
-
That's what I had come up with, and I was afraid that was the answer. I don't know that we want to set serveroutput on in glogin, and I wanted to handle it for the user. I suppose I'll use a script.
Thanks everyone!
Oracle DBA and Developer
-
You have 'users' using SQL*PLUS????
- Chris
-
Not usually. In this case, application developers on a development environment . . .
Oracle DBA and Developer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|