sql plus 中数据怎么输出

2024-11-14 11:24:12
推荐回答(2个)
回答1:

给你一个实际应用场景吧
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;

回答2:

你想把结果输出到 一个文本文档中吗?
如果是 使用如下:
spool d:\aa.sql;
select * from 表名;
spool off;
可以试下