• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2798
  • Last Modified:

How do you enable serveroutput on JDEVELOPER?

I am trying to do a DBMS_OUTPUT.PUT_LINE command in JDEVELOPER STUDIO 10.1.3.2.0.4066 and I get a Command Completed Successfully, I don't get the actual output.  Someone said I need to have SERVEROUTPUT on in order to see the output lines, does anyone know how to enable that in this version of JDEVELOPER?  I tried Set Serveroutput On in my PL/SQL code, but it gives me this error: missing or invalid option.

Any help would greatly be appreciated!

Thanks,
MS
0
mschwade
Asked:
mschwade
  • 5
  • 3
1 Solution
 
jwahlCommented:
SET SERVEROUTPUT ON

don't end with ';'!
0
 
mschwadeAuthor Commented:
Here's what I have and it doesn't work:

BEGIN
    SET SERVEROUTPUT ON
    FOR counter IN 1 .. 4
    LOOP
     DBMS_OUTPUT.PUT_LINE('Hello, World!');
    END LOOP;
END;

Error message:
ORA-06550: line 2, column 9:
PL/SQL: ORA-00922: missing or invalid option
ORA-06550: line 2, column 5:
PL/SQL: SQL Statement ignored
ORA-06550: line 7, column 1:
PLS-00103: Encountered the symbol "END"

Thanks!
0
 
sventhanCommented:


Try this...


SET SERVEROUTPUT ON
/
BEGIN
        FOR counter IN 1 .. 4
    LOOP
     DBMS_OUTPUT.PUT_LINE('Hello, World!');
    END LOOP;
END;
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
mschwadeAuthor Commented:
That didn't work either.. I think it may be that SQL*PLus is not installed, Im just using SQL Worksheet?
0
 
sventhanCommented:
Looks like you have the syntax issue.

if sql plus is not installed(not connected to the DB) , how do you get the ORA Error.
0
 
sventhanCommented:
you should put the "set serveroutput on" out of the begin and end block.
0
 
sventhanCommented:
try to run this in the Pl/sql block for the Jdeveloper and see ...

SET SERVEROUTPUT ON;
DECLARE
X NUMBER; -- just for testing
BEGIN
   FOR counter IN 1 .. 4
    LOOP
     DBMS_OUTPUT.PUT_LINE('Hello, World!');
    END LOOP;
END;
0
 
mschwadeAuthor Commented:
your code didn't work SV.. same error message.
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now