给你一个实际应用场景吧
set pages 999;
set heading off;
spool run_drop.Sql
Select 'drop ' || Do.object_type || ' ' || Do.owner || '.' || Do.object_name || ';'
From dba_objects Do
Where Do.owner = 'username' AND Do.object_type <> 'INDEX' And Do.object_type <> 'TRIGGER'
Order By Do.object_type;
spool off;
@run_drop.Sql;
你想把结果输出到 一个文本文档中吗?
如果是 使用如下:
spool d:\aa.sql;
select * from 表名;
spool off;
可以试下