set serveroutput
is not an SQL statement so it makes no sense to Aqua Data Studio or any other tool, except the IBM DB2 command line processors.
What dbms_output.put
does is store the line in an internal array in the dbms_output
module. DB2 tools access that array and print its contents to screen after executing your stored procedure.
You can in a way simulate the same behaviour in Aqua Data Studio by creating an exception handler in your stored procedure where you use dbms_output.get_lines
to return the line array, then build a cursor from that array using unnest()
and return the cursor to the calling application (Aqua).
It might be easier though to just create a logging stored procedure of your own, running an autonomous transaction, that would insert log records into a database table that you can query when necessary.