oracle数据库导入数据问题汇总

此次通过ctl文件导入数据,遇到问题在此记录一下!

1.sql文件出现乱码,导入也是乱码!

iconv -f gb18030 -t utf8 SCHOOL.sql -o SCHOOL1.sql

2.ctl文件导入出现乱码

添加 CHARACTERSET utf8

3.追加插入数据:

append into table school

fields terminated by '|'

trailing nullcols

(sendmsgid,

contents,

recvmsgid)

4.插入数据(只有是空表的时候才能够插入数据):

insert into table school

fields terminated by '|'

trailing nullcols

(sendmsgid,

contents,

recvmsgid)

5.插入数据报错:

插入数据字段长度不够

在ctl文件中,指定相应字段长度!

insert into table school

fields terminated by '|'

trailing nullcols

(sendmsgid,

contents  char(4000),

recvmsgid)

推荐阅读更多精彩内容