SQL*Plus - How do you hide SET ECHO OFF?

17,071

Solution 1

You might want to start SQL*Plus with the -S flag:

sqlplus -S user/password@db @path/to/your/script

The documentation says: SILENT Option

-S[ILENT]

Suppresses all SQL*Plus information and prompt messages, including the command prompt, the echoing of commands, and the banner normally displayed when you start SQL*Plus. If you omit username or password, SQL*Plus prompts for them, but the prompts are not visible! Use SILENT to invoke SQL*Plus within another program so that the use of SQL*Plus is invisible to the user.

SILENT is a useful mode for creating reports for the web using the SQLPLUS -MARKUP command inside a CGI script or operating system script. The SQL*Plus banner and prompts are suppressed and do not appear in reports created using the SILENT option.SILENT Option


So, with the silent option it seems that there won't be need to use set echo at all.

Solution 2

No, I know of no way to hide the 'set echo off' command itself, if echo is on.

However, echo is off by default. So, if echo is on when you initially start SQL*Plus, perhaps you have a login.sql or glogin.sql that contains 'set echo on'?

Check for glogin.sql in $ORACLE_HOME/sqlplus/admin, and for login.sql in the directory where you started SQL*Plus and any directory listed in $SQLPATH.

Hope that helps.

Share:
17,071
CristiC
Author by

CristiC

Self-teaching is the most powerfull instrument of all.

Updated on July 26, 2022

Comments

  • CristiC
    CristiC almost 2 years

    In SQL PLus, if I want to hide the command on screen, I use at the beginning of the script:

    SET ECHO OFF
    

    But what about this command? How to hide also this?

    In MS-Dos you could use @ in front of it, but in SQL*Plus?

    EDIT: I know the -S option for SQL*Plus, but the problem is that I am sending my script to the client and therefore I don't control how they are running SQL*Plus.

  • CristiC
    CristiC over 12 years
    I already knew this option. But the problem is that I am sending my script to the client and therefore I don't control how they are running SQL*Plus.
  • René Nyffenegger
    René Nyffenegger over 12 years
    Oh, I see. This is of course an important piece of information that merrits being added to the question.