0

I'd like to know if is possible use de DBMS_OUTPUT module of DB2 in a function and how can I use this when I'm running the select.

It's possible use something like:

SET SERVEROUTPUT ON

SELECT MYFUNCTION FROM TABLE;

Thanks

mayconbelfort
  • 195
  • 1
  • 5
  • 17

1 Answers1

0

Yes, you can use the DBMS_OUTPUT inside a function. Please take a look at the KnowledgeCenter: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.apdv.sqlpl.doc/doc/r0053534.html?lang=en

If you want to show the result of a select in dbms_output, you should use a cursor, assign the values to variables and then pass them to dbms_output.

Remember that the output will appear at the end of the execution of the function, not while it is executing.

AngocA
  • 7,655
  • 6
  • 39
  • 55
  • You can also use a software like log4db2, that can write the logs into a table, and retrieve the information in real time from another connection. – AngocA Feb 10 '15 at 02:53