SQL Loader使用

简介:
方式一:固定长度
load data  infile ’example.dat’ "fix 10"  into table example fields terminated by ’,’(col1, col2)
example.dat:
0001,abcd
0002,fghi
0003,klmn

方式二:前几个数字规定了后面的长度
load data infile ’example.dat’ "var 3“ into table example
fields terminated by ’,’ optionally enclosed by ’"’
(col1 char(5),col2 char(7))
example.dat:
009hello,cd,
010world,im,
012my,name is,

方式三:用特殊字符分割各字段,遇到转义字符,参考具体文档
load data
infile ’example.dat’ "str ’|\n’“ 
into table example
fields terminated by ’,’ optionally enclosed by ’"’
(col1 char(5),
col2 char(7))
example.dat:
hello,world,|
james,bond,|


本文转自 tianya23 51CTO博客,原文链接:http://blog.51cto.com/tianya23/242011,如需转载请自行联系原作者
相关文章
|
SQL Oracle 关系型数据库
|
SQL Oracle 关系型数据库
|
SQL Oracle 关系型数据库