excel格式的必需输出 [英] Required output on excel format

查看:78
本文介绍了excel格式的必需输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

xls格式所需的数据。请帮帮我。





设置反馈关闭

set pagesize 0

设置关闭

设置回声关闭

设置lineize 500

设置行200

设置验证关闭


SPOOL C:\DATA\ABN29977_BKG.xls



选择

' CNSG_NO'||','||

'BKG_DATE'||','||

'CNSGEE_NAM'||','||

'REF_NO'||','||

'DSTN'||','

FROM DUAL

UNION ALL

选择

substr(b.cnsg_no,1,12)||','||

TO_CHAR(b.bkg_dat,'DD- MON-YYYY')||','||

replace(substr(t.cnsgee_nam,1,30),',','')||','||

replace(substr(t.cnsgee_addr1,1,20),',','')||','||

t.dstn ||','

来自oms_cnsg_bill b,oms_cnsg_track t

其中b.cnsg_no = t.cnsg_no

和b.cus_no ='ABN29977 '

和截断(SYSDATE)-2和截断(SYSDATE)之间的b.bkg_dat -1



/

SPOOL OFF



退出;

required data on xls format. Please help me.


set feedback off
set pagesize 0
set head off
set echo off
set linesize 500
set line 200
set verify off

SPOOL C:\DATA\ABN29977_BKG.xls

Select
'CNSG_NO' ||','||
'BKG_DATE' ||','||
'CNSGEE_NAM' ||','||
'REF_NO' ||','||
'DSTN' ||','
FROM DUAL
UNION ALL
select
substr(b.cnsg_no,1,12) ||','||
TO_CHAR(b.bkg_dat,'DD-MON-YYYY') ||','||
replace(substr(t.cnsgee_nam,1,30),',','') ||','||
replace(substr(t.cnsgee_addr1,1,20),',','') ||','||
t.dstn ||','
from oms_cnsg_bill b, oms_cnsg_track t
where b.cnsg_no=t.cnsg_no
and b.cus_no='ABN29977'
and b.bkg_dat between trunc (SYSDATE)-2 and trunc (SYSDATE)-1

/
SPOOL OFF

EXIT;

推荐答案

您可以创建一个xls工作簿并将其连接到您的使用自动化的Oracle数据库。



请参阅使用自动化在工作表上创建QueryTable

http://support.microsoft.com/kb/247412/en-us [ ^ ]



您可以删除连接更新后从QueryTable对象。



如果安装了SQL Server Intergation Services,也可以使用它。



请参阅 SQL Server使用SQL Server Integration Services导出到Excel [ ^ ]
You may create an xls workbook and connect it to your Oracle database using automation.

See "Use automation to create a QueryTable on a worksheet" at
http://support.microsoft.com/kb/247412/en-us[^]

You may remove the connection from the QueryTable object after updating.

Also you may use SQL Server Intergation Services if you have it installed.

See SQL Server Export to Excel using SQL Server Integration Services[^]


这篇关于excel格式的必需输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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