Spool file is getting duplicates

泄露秘密 提交于 2020-01-25 14:18:55

问题


I have created the following Script ( name.sql ) which is then called from a windows.bat file.

The problem is that the .xls file that is created has twice the resultset from the SQL query.

I send you the script to help me udnerstnad what i do wrong in the .sql script:

set linesize 999 verify off feedback off
set markup html on entmap on spool on preformat off table 'align=right width=40% 
border=10 bordercolor=black bgcolor=white'
set echo off pagesize 1000 linesize 255 feedback off heading on;
set serveroutput off

del "D:\weekly_orders.xls"

SPOOL d:\weekly_orders1.xls

select * from x where id='1-6A86P9C'  order by x_date;

/

SPOOL OFF;

exit

回答1:


Remove the slash that is on the line by itself. It tells SQL/Plus to repeat the last command.

See the answers in this question regarding slash vs semi-colon when used in SQL scripts: When do I need to use a semicolon vs a slash in Oracle SQL? for more information and explanations of what is going on.



来源:https://stackoverflow.com/questions/23107630/spool-file-is-getting-duplicates

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!