想加载日期类型数据只需要在控制文件中增加DATE数据类型,并指定日期格式,格式和数据库中提供的日期函数中指定的那些格式一样。
测试开始
[oracle@oraclelinux ~]$ cat dept_load9.ctl
load data
infile *
into table dept_load
replace
fields terminated by ','
(deptno,
dname,
loc,
last_updated date 'dd/mm/yyyy'
)
begindata
10,sales,virginia,1/5/2000
20,accounting,virginia,21/6/1999
30,consulting,virginia,5/1/2000
40,finance,virginia,15/3/2001
[oracle@oraclelinux ~]$ exit
exit
SQL> truncate table dept_load;
Table truncated.
SQL> !
[oracle@oraclelinux ~]$ sqlldr userid=scott/scott control=dept_load9.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 14 12:24:12 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 4
[oracle@oraclelinux ~]$ exit
exit
SQL> select * from dept_load;
DEPTNO DNAME LOC ENTIRE_LINE LAST_UPDA
---------- -------------- ------------- ----------------------------- ---------
10 sales virginia 01-MAY-00
20 accounting virginia 21-JUN-99
30 consulting virginia 05-JAN-00
40 finance virginia 15-MAR-01
SQL>
测试结束
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15720542/viewspace-723497/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/15720542/viewspace-723497/