且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将列标题删除到输出文本文件中

更新时间:2023-10-17 18:07:04

SQLPLUS COMMAND跳过:开始前进

SQLPLUS COMMAND Skipped: set heading off

该消息很可能是因为您不是通过SQL*Plus而是通过某些基于GUI的工具来执行该消息.您正在SQL Developer中使用SQLPlus命令.并非所有SQL * Plus命令都保证可以与 SQL Developer 一起使用.

That message is most likely because you are not executing it through SQL*Plus, but some GUI based tool. You are using SQLPlus command in SQL Developer. Not all SQL*Plus commands are guaranteed to work with SQL Developer.

我建议您在 SQLPlus 中执行脚本,并且不会出现任何问题.

I would suggest you execute the script in SQLPlus and you would see no issues.

您需要:

SET HEADING OFF

这不会在输出中包括列标题.

This will not include the column headers in the output.

或者,您也可以这样做:

Alternatively, you could also do this:

SET PAGESIZE 0

使用SQL Developer 3.2.20.10 :

spool ON
spool D:\test.txt
SET heading OFF
SELECT ename FROM emp;
spool off

创建的假脱机文件没有问题:

Spool file got created with no issues:

> set heading OFF
> SELECT ename FROM emp
SMITH      
ALLEN      
WARD       
JONES      
MARTIN     
BLAKE      
CLARK      
SCOTT      
KING       
TURNER     
ADAMS      
JAMES      
FORD       
MILLER     

 14 rows selected