Using SqlPlus for Oracle, how do I save the output of a query in a file but not show it on the terminal/prompt.
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.
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 ... > /
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With