使用sql loader基于字符串值加载数据

时间:2014-08-21 07:05:05

标签: unix oracle11g sql-loader

我有一个类似

的数据集
  

1,2,3,4,5,{1,2,3,4},{1,2,3,4}

我想将数据加载为

 columnA ColumnB ColumnC ColumnD ColumnE ColumnF   COlumnG
 1       2       3       4       5       {1,2,3,4} {1,2,3,4}

我使用了columnF和ColumnG作为clob

1 个答案:

答案 0 :(得分:1)

您需要将数据集括在

"1","2","3","4","5","{1,2,3,4}","{1,2,3,4}"

控制文件必须读取

LOAD DATA
  INFILE *
Truncate
INTO TABLE IMPORT_TEST
FIELDS TERMINATED BY ',' optionally enclosed by '"'
TRAILING NULLCOLS
(columnA,columnB,columnC,columnD,columnE,columnF,columnG)
begindata
"columnA","columnB","columnC","columnD","columnE","columnF","columnG"
"1","2","3","4","5","{1,2,3,4}","{1,2,3,4}"