假脱机文件越来越重复 [英] Spool file is getting duplicates

查看:108
本文介绍了假脱机文件越来越重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了以下脚本(name.sql),然后从windows.bat文件中调用该脚本.

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

问题在于所创建的.xls文件具有SQL查询结果集的两倍.

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

我向您发送了脚本以帮助我udnerstnad我在.sql脚本中做错了什么:

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

推荐答案

单独删除在线上的斜杠.它告诉SQL/Plus重复最后一条命令.

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

在SQL脚本中使用时,请参阅此问题中有关斜杠与分号的答案: 何时需要在Oracle SQL中使用分号和斜杠?有关发生了什么的更多信息和解释.

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.

这篇关于假脱机文件越来越重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆