Server output is client-side functionality that not all clients support. SQL * Plus and SQL Developer, but that’s not what any other client will be.
The SQL * Plus client command set serveroutput on essentially calls the DBMS_OUTPUT.enable() stored procedure on your behalf. In addition, it signals the client, which must check the DBMS_OUTPUT.get_lines() procedure for cached output after each block of code is executed.
If DataGrip does not, you can manually program calls to DBMS_OUTPUT.enable() and DBMS_OUTPUT.get_lines() as needed.
source share