请教
文本数据格式如下:
2| 1.10| 10 | 1,000.00|03
3| 3,000.10| 10 | 1,111,000.00|03
控制文件如下:
load data
infile 'e:\xx.txt'
append into table txx
(act_1 char terminated by '|',
txn_2 char terminated by '|' ,
proc_3 char terminated by '|',
txn_4 char terminated by '|',
new_5 char terminated by whitespace)
其中txn_2,new_5在txx表中为number(13,2)类型的数据。如何处理呢????
请大家给予帮助,谢谢
文本数据格式如下:
2| 1.10| 10 | 1,000.00|03
3| 3,000.10| 10 | 1,111,000.00|03
控制文件如下:
load data
infile 'e:\xx.txt'
append into table txx
(act_1 char terminated by '|',
txn_2 char terminated by '|' ,
proc_3 char terminated by '|',
txn_4 char terminated by '|',
new_5 char terminated by whitespace)
其中txn_2,new_5在txx表中为number(13,2)类型的数据。如何处理呢????
请大家给予帮助,谢谢
解决方案 »
- 请问我在删除表时提示有主外键使用中,求解决方法和批量删除方法
- 基础问题
- 在sql语句中调用自建函数,执行时提示ORA-01722: 无效数字
- 请教一个ORACLE+ASP关于SEQUENCE的问题
- RMAN 恢复数据库失败,求救!在线急等!
- 是谁更改了我地数据库表记录?
- oracle支持内联接,外联接吗
- 关于导出的汉字中出现?的问题
- 多表关联,怎么用解发器删除?
- 请教:怎样把连接好的Oracle数据库用表格的形式显示出来?
- 100分!!!如何用SQL PLUS远程登陆ORACLE数据库(请高手详细做答)
- 请问我想取出记录集的第30之60条记录,应该怎么写呢?我写成where rownum>30 and rownum<60为什么选不出来纪录呢?
文本文件d:\xx.txt:
2| 1.10| 10 | 1,000.00| 03
3| 3,000.10| 10 | 1,111,000.00| 03控制文件d:\a.ctl:
load data
infile 'd:\xx.txt'
append into table txx
fields terminated by '|'
(act_1,
txn_2 "replace(:txn_2,',','')",
proc_3 position(22:23),
txn_4 "replace(replace(:txn_2,',',''),',','')",
new_5 position(50:51)
) 表结构:
SQL> desc txx;
名称 是否为空? 类型
----------------------------------------- -------- ---------------------------- ACT_1 CHAR(1)
TXN_2 NUMBER(13,2)
PROC_3 CHAR(2)
TXN_4 NUMBER(13,2)
NEW_5 CHAR(2)执行sqlldr前:
20:10:37 SQL> select * from txx;未选定行执行sqlldr后:
20:10:51 SQL> select * from txx;A TXN_2 PR TXN_4 NE
- ---------- -- ---------- --
2 1.1 10 1.1 3
3 3000.1 10 3000.1 3Good luck!!
列的 SQL 串: "replace(:txn_amt,',','')"
TXN_MENO NEXT * | CHARACTER
REDEPOST_AMT NEXT * | CHARACTER
列的 SQL 串: "replace(:redepost_amt,',','')"
NEW_BAL NEXT * WHT CHARACTER