WEB开发网
开发学院数据库Oracle sqlldr的用法总结 阅读

sqlldr的用法总结

 2008-12-17 13:06:00 来源:WEB开发网   
核心提示: = 注意begindata后的数值前面不能有空格1 * 普通装载LOAD DATAINFILE *INTO TABLE DEPTREPLACEFIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'(D

=====================================================================================

//////////// 注意begindata后的数值前面不能有空格

1 ***** 普通装载

  LOAD DATA
  INFILE *
  INTO TABLE DEPT
  REPLACE
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  (DEPTNO,
  DNAME,
  LOC
  )
  BEGINDATA
  10,Sales,"""USA"""
  20,Accounting,"Virginia,USA"
  30,Consulting,Virginia
  40,Finance,Virginia
  50,"Finance","",Virginia // loc 列将为空
  60,"Finance",,Virginia // loc 列将为空

2 ***** FIELDS TERMINATED BY WHITESPACE 和 FIELDS TERMINATED BY x'09' 的情况

  LOAD DATA
  INFILE *
  INTO TABLE DEPT
  REPLACE
  FIELDS TERMINATED BY WHITESPACE
  -- FIELDS TERMINATED BY x'09'
  (DEPTNO,
  DNAME,
  LOC
  )
  BEGINDATA
  10 Sales Virginia

3 ***** 指定不装载那一列

  LOAD DATA
  INFILE *
  INTO TABLE DEPT
  REPLACE
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  ( DEPTNO,
  FILLER_1 FILLER, // 下面的 "Something Not To Be Loaded" 将不会被装载
  DNAME,
  LOC
  )
  BEGINDATA
  20,Something Not To Be Loaded,Accounting,"Virginia,USA"

上一页  1 2 3 4  下一页

Tags:sqlldr 用法 总结

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接