SPOOL命令不会在查询中保存结果 [英] SPOOL command doesnt save result in query
问题描述
我正在使用SQL Developer,并且正在尝试使用假脱机命令将查询结果保存到文本文件中.
I'm using SQL Developer and I'm trying to save result of a query into the text file using spool command.
spool D:\file.txt
SELECT * FROM TABLE
SPOOL OFF
当我打开创建的文件时,它只包含我的查询: 选择*从表" 但不是结果.我在做什么错了?
When I open created file it only has my query in it: "SELECT * FROM TABLE" but not result of it. What am I doing wrong?
推荐答案
尝试通过查询执行该查询,该查询返回的行较少,以查看是否还有其他问题.使它工作后,请尝试查询. 在运行语句和运行脚本之间也有区别.
Try to execute it with a query which returns fewer rows to see if you have any other problems. After you make it work, try your query. Also there is a difference between Run Statement and Run Script.
在以下查询中
spool '/home/atilla/file.txt'
SELECT * FROM DUAL;
SPOOL OFF
如果我使用运行语句,则会得到以下文件
If I use Run Statement, I get following file
\> SELECT * FROM DUAL
如果我使用运行脚本,则会得到以下文件
If I use Run Script, I get following file
\> SELECT * FROM DUAL
DUMMY
-----
X
这篇关于SPOOL命令不会在查询中保存结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!