【问题标题】:Spool file is getting duplicates假脱机文件越来越重复
【发布时间】:2014-04-16 11:06:08
【问题描述】:

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

问题是创建的 .xls 文件的结果集是 SQL 查询的两倍。

我将脚本发送给您以帮助我了解我在 .sql 脚本中做错了什么:

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

【问题讨论】:

    标签: sqlplus spool


    【解决方案1】:

    单独删除该行上的斜线。它告诉 SQL/Plus 重复上一个命令。

    查看此问题中有关在 SQL 脚本中使用斜杠与分号的答案: When do I need to use a semicolon vs a slash in Oracle SQL? 了解更多信息和正在发生的事情的解释。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-05
      • 2013-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-31
      • 2016-03-05
      相关资源
      最近更新 更多