Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 818
CristiC Avatar asked Oct 28 '11 18:10

CristiC


2 Answers

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.

like image 118
René Nyffenegger Avatar answered Oct 13 '22 10:10

René Nyffenegger


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.

like image 34
Mark J. Bobak Avatar answered Oct 13 '22 10:10

Mark J. Bobak