Name

SET ECHO

Synopsis

The ECHO setting tells SQL*Plus whether you want the contents of script files to be echoed to the screen as they are executed.

Syntax

SET ECHO {OFF | ON}

Parameters

OFF

Keeps commands from being echoed to the screen while a script file is being executed. This is the default setting.

ON

Causes commands from a script file to be echoed to the screen as they are being executed.

Examples

SET ECHO is one of the few debugging tools SQL*Plus has. It often helps to turn on command echoing while you are developing and testing a new script file. The following example shows the same script file being executed, once with ECHO on and once with it off:

SQL> @c:\a\echo_test
D
-
X
SQL> SET ECHO ON
SQL> @c:\a\echo_test
SQL> SELECT * FROM dual;
D
-
X

For the second execution of the script, ECHO had been turned on, so the SELECT statement was displayed on the screen when SQL*Plus executed it.

Tip

If you are writing a script that spools data to a file, you will almost certainly want to leave ECHO off. Otherwise, the commands in your script would be spooled to the file along with the data.

Get Oracle SQL*Plus: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.