Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use dbms_output.put_line in Datagrip for .sql files

I started to use Datagrip for my PL/SQL (school) projects that need the use of DBMS_OUTPUT.PUT_LINE. Before this I was using Oracle SQL developer and I was able to use DBMS_OUTPUT by adding the following:

SET serveroutput ON;

There is a related question that shows how to enable or disable showing the contents of the DBMS_OUTPUT buffer but this only works for the Database Console tool window. How can I apply this to any .sql file? Currently, I am copying the content of my .sql files and run it in the Console tool window but there must be a better way.

like image 332
Cezar Cobuz Avatar asked Apr 02 '18 07:04

Cezar Cobuz


People also ask

Can I use DBMS_OUTPUT Put_line?

The Oracle dbms_output. put_line procedure allows you to write data to flat file or to direct your PL/SQL output to a screen. Here is a code example using dbms_output.

Does DBMS_OUTPUT Put_line affect performance?

So yes, dbms_output. put_line decreases the performance.

How do I display output in SQL?

To do this we use a procedure called dbms_output. put_line to place the results in a buffer that SQL*Plus will retrieve and display. SQL*Plus must be told to retrieve data from this buffer in order to display the results. The SQL*Plus command 'set serveroutput on' causes SQL*Plus to retrieve and display the buffer.

Where does DBMS_OUTPUT write to?

Using DBMS_OUTPUT, the text is generated in the server while it executes your query and stored in a buffer. It is then redirected to your client app when the server finishes the query data retrieval.


1 Answers

Turn on this setting in the Output pane: enter image description here

like image 50
moscas Avatar answered Sep 22 '22 04:09

moscas