关闭

sqlloader 倒数脚本

标签: tabledatabase2010脚本input
400人阅读 评论(0) 收藏 举报
分类:

echo "********************************************"
echo "倒数脚本"
echo "导入表为:hi.tb_test_input"
echo "********************************************"                            
echo "请先清空临时表数据 truncate table hi.tb_test_input; "
echo "临时表清空了吗(Y/N)"
read ans
echo "请输入要上传的文件名称"  
read name              
#"*********把文本中的'M'替换成空格**********"
//'  /jm_temp/BACKUP/$name>/jm_temp/BACKUP/input.txt
echo "替换完成,详情请查看input.txt"   
echo "loAD DATA
INFILE /"/jm_temp/BACKUP/input.txt/"
append into table hi.tb_test_input
 fields terminated by /"/"
 trailing nullcols
                                (
        servnumber                                                                                           
                                )">hdjr_20101206.ctl           
                                               
sqlldr userid=username/password@database control=hdjr_20101206.ctl data=/jm_temp/BACKUP/input.txt log=hdjr_20101206.log errors=0 direct=true

 

 

--------------------------------------------------------------

cat>test.ctl 
loAD DATA
INFILE "/jm_temp/kkk/test.txt"
 truncate into table hi.tb_kkk_20101104_lodr
 fields terminated by "|"
 trailing nullcols
 (                                  
    servnumber     "trim(:servnumber)"   
   ,slrq           "trim(:slrq)"   
   ,famc           "trim(:famc)"                                                                                                                                           
 )   
 
                        
sqlldr userid=username/pwd@database control=test.ctl  data=/jm_temp/kkk/test.txt log=hdjr_20101206.log errors=0 direct=true

 

 

cat>hdjr_20101206.ctl
loAD DATA
INFILE "/jm_temp/BACKUP/t.txt"
append into table hi.tb_test_input
 fields terminated by ""
 trailing nullcols
                 (
     servnumber                                                                                           
                 )

 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:90615次
    • 积分:1456
    • 等级:
    • 排名:千里之外
    • 原创:63篇
    • 转载:6篇
    • 译文:1篇
    • 评论:1条
    文章分类