Quick Question: Is there a way in SQL Developer to have the DBMS Output window clear when you execute a block?

Quick Answer: CLEAR SCREEN [Oracle Docs]

SQL Developer supports many, and soon to be ALL, SQL*Plus commands. CLEAR is one of them. So just add this to the top of your script. When you execute your script, the Output Panel will clear.

CLEAR SCREEN command support in Oracle SQL Developer
CLEAR SCREEN command support in Oracle SQL Developer

You’ll see there’s the output from the previous run, then we execute, and then we scroll back up the buffer – the previous execution output is gone.

If you’re curious about what all SQL*Plus commands we support, check out the the Help Topic on the subject:

Supported SQL*Plus Commands in Oracle SQL Developer
Supported SQL*Plus Commands in Oracle SQL Developer

So, if you like the /*csv*/ script output ‘trick’ in SQL Developer, you can use the good ole SQL*Plus SPOOL command to write that output to your CSV file automagically as well.

Just remember, for the SQL*Plus engine to be invoked in SQL Developer – use the ‘Run Script’ or F5 button on the Worksheet toolbar:

This one!
This one!
Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

4 Comments

  1. Your answer doesn’t answer the question 🙂 Please note that “DBMS output” window is different to “Script output” window. Question was:

    “Quick Question: Is there a way in SQL Developer to have the DBMS Output window clear when you execute a block?”

    I see there are 2 options available: shortcut key and mouse click on clear. But not command (I’m OK with that).

    • But you can’t use CLEAR short-cut keys from code editor window (where usually user is located), which make it not very usable. So any other option how to clear “DBMS output” window from code editor window?

    • Yes – dont use the dbms output window – write your output to the script window using SERVEROUTPUT ON.

Reply To thatjeffsmith Cancel Reply