vi append.sh
#!/bin/bash
sqlldr userid=bm_weihu/itms_xianwan control=input2.ctl
vi input2.ctl
LOAD DATA
infile '/oracle/oracle/Thatcher/Device_HeXiao/201504/ITMS_04.csv'
append into table ITMS_VERIFICATION_REPORT
fields terminated by ',' TRAILING NULLCOLS
(
--SEQUENCE_NO,
QU_JU ,
FEN_JU ,
ZHAN_DIAN ,
DEVICE_SERIAL_NO ,
AD_NO ,
CRM_ORDER_NO ,
TYPE ,
OUTSOURING_COMPANY,
EXTERNAL_WORK_NO ,
WORK_ORDER_STATUS ,
ARCHIVE_TYPE ,
P6_WORK_NO ,
VERIFICATION ,
VERIFICATION_TIME ,
CLIENTTYPE ,
PDA
)
#!/bin/bash
#oracle服务器导出excel方法:
#另外可以取消几百行一空行的格式
sqlplus -S bm_weihu/itms_xianwan <<EOF
spool /oracle/oracle/Thatcher/Device_HeXiao/201506/ITMS_201506_OUT.xls
set heading off;
set serveroutput off;
set linesize 400;
set trimspool on;
set term off verify off feedback off pagesize 5000;
set markup html on entmap ON spool on preformat off;
SELECT * FROM ITMS_Verification_Final_Report;
spool off
EXIT
EOF
~