将oracle的查询结果输出为文件


将oracle的查询结果输出为文件

首先编辑一个脚本文件,比如命名为abc.sh
spool abc.txt; #将结果输出为abc.txt
select * from wap_subscribe where Telcomcompanyid = '20200' and (Orderdate like '2005%' or Disorderdate like '2005%');
spool off;

在sql>模式下使用@/opt/abc.sh即可,查询结果即输出到abc.txt了

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus