DBMS output is not displayed in Oracle SQL Developer

0

For some reason, when executing the following code, the result of the query is not shown by the output of dbms. The same code has been tested on another PC and it works. For the script output shows that everything went well:

  

PL / SQL procedure terminated correctly.

BEGIN
For x IN(SELECT SECONDARY_INVENTORY_NAME FROM MTL_SECONDARY_INVENTORIES WHERE ORGANIZATION_ID=203)LOOP
        DBMS_OUTPUT.PUT_LINE(x.SECONDARY_INVENTORY_NAME);
    END LOOP;
END;

I have no more information to explain this. What can I be going through and not let the result come out of the DBMS output?

    
asked by Daniel Ruiz 23.11.2017 в 09:26
source

2 answers

2

To be able to see the output of DBMS_OUTPUT in SQL Developer, you must follow the following 2 stages:

  • Open the Dbms Output window.

    This you do from the menu: View - > Dbms Output .

  • Activate DBMS_OUTPUT for the connection to the database.

    To do this, press the + icon, select the appropriate connection and press OK .

  • Everything should work correctly now.

        
    answered by 23.11.2017 в 15:58
    1

    If you are calling the procedure from a terminal (I hope so), try:

    set serveroutput on;
    

    Or in the script, at the beginning, you write it to be activated directly.

    set serveroutput on
    
    BEGIN
    For x IN(SELECT SECONDARY_INVENTORY_NAME FROM MTL_SECONDARY_INVENTORIES WHERE ORGANIZATION_ID=203)LOOP
            DBMS_OUTPUT.PUT_LINE(x.SECONDARY_INVENTORY_NAME);
        END LOOP;
    END;
    

    Next, call / execute the procedure again and the output of the dbms_ouput should already appear.

        
    answered by 24.12.2017 в 19:42