删除不需要的标头和sql结果的底部

时间:2013-06-25 08:39:18

标签: sql oracle unix stored-procedures

我在unix中执行一个sql脚本,说 sqlplus -L cimkroger / cimkroger @ orcl @ procdemo.sql> demo.txt 。它会在 demo.txt 文件中生成正确的结果。但我不希望在demo.txt部分中连接,SQL * Plus,Disconneted,...等文本。无论如何在sql查询中我可以避免这种情况.Below是demo.txt文件的内容。

SQL*Plus: Release 11.1.0.6.0 - Production on Tue Jun 25 14:03:26 2013

Copyright (c) 1982, 2007, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

136209
136220
136152
136248
136196
136227
136163
136234
136174
136241
136185
135910

PL/SQL procedure successfully completed.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

1 个答案:

答案 0 :(得分:3)

使用the -s flag来调用silent mode

sqlplus -S -L cimkroger/cimkroger@orcl @procdemo.sql > demo.txt

命令行选项显示为in the documentation