Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> spooling statement problem

spooling statement problem

From: Kirk W. Conrad <kwconrad_at_mdanderson.org>
Date: Mon, 21 May 2001 10:03:05 -0500
Message-ID: <9ebanc$2o6$1@oac2.hsc.uth.tmc.edu>

I'm spooling derived statements to a file that I want to execute in sqlplus. The problem is that the statement I'm using is spooling to the file as is the "spool off" statement. All I want is the resulting analyze statements. I use the following commands.

set feedback off
set pagesize 0
set line 255
set trimspool on
set termout off
spool c:\temp\chain.sql;
select 'analyze table ' || owner || '.' || table_name || ' list chained rows;'
from dba_tables
where chain_cnt <> 0 and (chain_cnt/num_rows) > .1 and owner not in ('SYS','SYSTEM');
spool off;

 I get the following in the file.

SQL> select 'analyze table ' || owner || '.' || table_name || ' list chained rows;'
  2 from dba_tables
  3 where chain_cnt <> 0 and (chain_cnt/num_rows) > .1   4 and owner not in ('SYS','SYSTEM');
analyze table LAWTEST.LAW_DBA_INDEX list chained rows; analyze table LAWTEST.LAW_DBA_TABLE list chained rows; SQL> spool off;

Any help appreciated.
Kirk Received on Mon May 21 2001 - 10:03:05 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US