SQLLOAD数据的时候,建表给的字段给够了,建表已经给到VHARCHAR2(1024)了,实际数据是VHARCHAR2(256).加载报错"数据文件的字段超出最大长度"查了半天,发现问题在于,前人CTL文件为了图方便,以
LOAD #
INFILE '#/aps_userlevel.txt'
PRESERVE BLANKS
INTO TABLE aps_userlevel
FIELDS TERMINATED BY "|"
TRAILING NULLCOLS
(
userlevel,
userlevelname,
renttype,
rentfee
)
INFILE '#/aps_userlevel.txt'
PRESERVE BLANKS
INTO TABLE aps_userlevel
FIELDS TERMINATED BY "|"
TRAILING NULLCOLS
(
userlevel,
userlevelname,
renttype,
rentfee
)
这种模式书写,没有在每个字段后面定义数据类型,碰到此种情况,Oracle默认为该字段为VARCHAR(255)[或者实际默认为CHAR(255)?]反正是小于256,后更改为
LOAD #
INFILE '#/aps_userlevel.txt'
PRESERVE BLANKS
INTO TABLE aps_userlevel
FIELDS TERMINATED BY "|"
TRAILING NULLCOLS
(
userlevel,
userlevelname,
renttype CHAR(1024),
rentfee
)
INFILE '#/aps_userlevel.txt'
PRESERVE BLANKS
INTO TABLE aps_userlevel
FIELDS TERMINATED BY "|"
TRAILING NULLCOLS
(
userlevel,
userlevelname,
renttype CHAR(1024),
rentfee
)
加载正常