问题
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