Show DBMS Output

One Star

Show DBMS Output

Hello,
I try to show Oracle DBMS output from a PLSQL block.
For example:
begin
dbms_output.put_line('Hello World');
end;
To show the output I must aktivate it with:
set serveroutput on;
I try to do it with a tSQLTemplate, but i get an error by executing "set serveroutput on;":
connecting to socket on port 3531
connected
Exception in component tSQLTemplate_1
java.sql.BatchUpdateException: Fehler bei Stapelverarbeitung aufgetreten: ORA-00922: Fehlende oder ungültige Option
at oracle.jdbc.driver.OracleStatement.executeBatch(OracleStatement.java:4534)
at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:213)
at core1.st_filiale_0_2.ST_Filiale.tSQLTemplate_1Process(ST_Filiale.java:804)
at core1.st_filiale_0_2.ST_Filiale.tOracleConnection_1Process(ST_Filiale.java:727)
at core1.st_filiale_0_2.ST_Filiale.runJobInTOS(ST_Filiale.java:1026)
at core1.st_filiale_0_2.ST_Filiale.main(ST_Filiale.java:891)
disconnected
If i execute the generated SQL from the debuger in the sqldeveloper it works fine.
Is there another way to give output ?
Thank You for your time!
Seventeen Stars

Re: Show DBMS Output

As long as I know you can only see the output in the Oracle sqlplus program. I suggest using your own procedure which writes the output + timestamp + user in your own table and you can access this table via jdbc.
You could try to use your own function to read the output but you have to call the function as much often you want to see the output, there is not trigger functionality for this. Here is a probably useful link:
http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_output.htm
One Star

Re: Show DBMS Output

Hello Jlolling,
thank You for your fast answer.
I would try it. If I would found another way I will post it here.