How to hide or supresss sql query output from the log file (spool file ) in sqlplus

oracle, sql, sqlplus

Solution

set autotrace traceonly exp stat

will cause SQL*Plus not to print the results of the query. It sounds like that's what you're looking for.

Problem

I’m doing performance testing for my application. I gathered around 100 queries from the application and wanted execute the queries exactly as it's being executed through the application. As some quires are giving more than 1000 records, I wanted to hide the sql output in log file. I just wanted to collect Elapsed Time and Explain Plan. Sql Template File: ``` spool &1 set timing on set linesize 100 set pagesize 5000 set termout off set echo on set autotrace on exp stat define sql_version = '0.1'; set echo on; set heading off; set feedback off; set verify off; set timing off; select ' Baseline SQL Testing - Version &sql_version : Date - ' || sysdate from dual; set timing on; set verify on; set feedback on; set heading on; set echo on; spool off; exit; ```

Original source