| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: spooling statement problem
"Kirk W. Conrad" wrote:
> 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 echo off -- this will remove all commands from the output.
>
> 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 - 20:43:07 CDT
![]() |
![]() |