4 Replies Latest reply on Oct 5, 2017 9:35 PM by Mustafa KALAYCI

    DBMS_OUTPUT in UDF function shown in SQL Developer

    InfoDoc

      I have a simple test function:

       

       

       

      1. create or replace function put_line_function return string as 
      2. begin 
      3. dbms_output.put_line('this is some output'); 
      4. return 'x'
      5. end put_line_function; 

       

      in sql developer I

       

      set SERVEROUTPUT ON;

       

      Then I open the DBMS output window

       

      then I connected the dbms output window to the same db as my sql worksheet.

       

      then I call the function in a simple sql:

      select put_line_function from dual;

       

      But I never see the DBMS_OUTPUT from the PUT_LINE function

       

      My goal was to have my db functions spit out informational messages when useful to our database team.

       

      Is there a way to do this in oracle user defined functions?

       

       

      ps: I also had this at the start of my function, but it did not help either:

       

      DBMS_OUTPUT.ENABLE();