如何在SQL Developer Oracle中使用假脱机命令 [英] How to use spool command in sql developer oracle
问题描述
亲爱的,
我不能使用假脱机命令.它不起作用,或者我没有做正确的事.
我正在尝试将查询结果保存到txt文件中(也尝试过使用select /*csv*/ * from table
保存csv,但是它也无法正常工作.)
Dears,
I cannot use spool command. It is not working or i am not doing something right.
I am trying to save query result in txt file (tried also csv saving with select /*csv*/ * from table
but it also did not work).
所以我写的是:
set echo off
set trimspool on
spool 'C:\Users\username\Desktop\clobams\Test1.txt'
select pn, serial_number from stock ;
spool off;
按execute statement
ORA-00900:invalid SQL statement
时出现错误. SQL工作正常-当我仅执行该部分时,它将输出显示到屏幕上.我应该如何将输出保存到文件中?
And i am getting error when pressing execute statement
ORA-00900:invalid SQL statement
. Sql works fine - when i execute only that part,it gives me output to the screen. How should i save my output to the file?
我已经尝试删除set echo off
和set trimspool on
,但是这些都没有帮助
I have already tried to remove set echo off
and set trimspool on
but none of these helped
推荐答案
这是我在SQL开发人员上运行的内容:
this is what i have run on my sql developer:
spool C:\Users\**direcotory**\Desktop\old desktop\sql\Test1.txt;
select * from YOUR_TABLE;
spool off;
我在文件test1中得到了输出.您需要将所有命令作为脚本运行.
and i got output in file test1. you need to run all commands as script.
这篇关于如何在SQL Developer Oracle中使用假脱机命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!