Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle SqlPlus - saving output in a file but don't show on screen

Tags:

oracle

sqlplus

Using SqlPlus for Oracle, how do I save the output of a query in a file but not show it on the terminal/prompt.

like image 898
simplfuzz Avatar asked Jul 25 '11 08:07

simplfuzz


People also ask

How do I display output in SQL Plus?

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.

What is SQLPlus silent mode?

The "silent" mode doesn't prevent terminal output. All it does is: -S Sets silent mode which suppresses the display of the SQL*Plus banner, prompts, and echoing of commands. If you want to suppress all terminal output, then you'll need to do something like: sqlplus ... > /

Which command is used to direct the SQL output to a screen?

Spooling From SQL Command LineThe SPOOL command can be used to direct the output from SQL Command Line to a disk file, which enables you to save the output for future review.


1 Answers

Right from the SQL*Plus manual
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch8.htm#sthref1597

SET TERMOUT

SET TERMOUT OFF suppresses the display so that you can spool output from a script without seeing it on the screen.

If both spooling to file and writing to terminal are not required, use SET TERMOUT OFF in >SQL scripts to disable terminal output.

SET TERMOUT is not supported in iSQL*Plus

like image 65
a_horse_with_no_name Avatar answered Sep 22 '22 04:09

a_horse_with_no_name