Thursday, November 8, 2012

Remove SQL Query from SQLPLUS Spool file ORACLE

ISSUE:
SQL query was spooled out by sqlplus spool command when only results need be in spool file

SOLUTION:
Condition 1: spool command was executed mannually through interactive sqlplus prompt
run below set in sqlplus

SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 80
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET MARKUP HTML OFF
set trimspool on

Condition2: spool command was executed through shell script automatically.
start sqlplus with S (capital s) option. 
and include below set in the script.
set pagesize 0
set linesize 180
set feedback off
set trimspool on


Spool file should include only results. 

reference:
https://forums.oracle.com/forums/thread.jspa?messageID=3961450
http://www.the-playground.de/joomla/index.php?option=com_content&view=article&id=252:hide-sql-query-in-sqlplus-spool-file&catid=18:tipsntricks&Itemid=37


1 comment:

  1. Whether you are an amateur or have been sewing for quite a long time, there are sure fundamental things that you have to deliver proficient results. On the off chance that your financial plan permits, acquiring quality, enduring things will yield more noteworthy fulfillment after some time. You require not purchase each idea and contraption available. There are, in any case, certain fundamental sewing supplies that ought to be in everybody's wicker bin. It may include spools and thimbles

    ReplyDelete