1个回答
展开全部
1、用sqlplus执行
spool emp.xls
select * from emp;
spool off即可
2、实例
#!/bin/sh
#!/bin/bash
today=`date +%Y%m%d`
file=emp_${today}.xls
sqlplus 'scott/tigger' << EOF
set linesize 200
set head off
set term off verify off feedback off pagesize 999
set markup html on entmap ON spool on preformat off
alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS';
spool $file
select * from emp;
spool off
quit;
EOF
#处理一下文件头
sed -i '/select/d' $file
sed -i '/spool/d' $file
spool emp.xls
select * from emp;
spool off即可
2、实例
#!/bin/sh
#!/bin/bash
today=`date +%Y%m%d`
file=emp_${today}.xls
sqlplus 'scott/tigger' << EOF
set linesize 200
set head off
set term off verify off feedback off pagesize 999
set markup html on entmap ON spool on preformat off
alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS';
spool $file
select * from emp;
spool off
quit;
EOF
#处理一下文件头
sed -i '/select/d' $file
sed -i '/spool/d' $file
更多追问追答
追问
看到了。let me try try
追答
删掉set markup html on entmap ON spool on preformat off
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询