随笔 - 589  文章 - 0 评论 - 116 trackbacks - 5

步骤:

1. 创建表

2.准备平面文件

3.准备CTL文件

4. 把平面文件和ctl文件上传到服务器

5.在sql editor中执行import语句

在操作过程中,只需要根据以下样例准备数据即可。

 

创建相应的表结构:

CREATE COLUMN TABLE "STUDENT"."CUSTOMER" ("ORDERID" INTEGER CS_INT NOT NULL ,
     "CUSTOMERID" INTEGER CS_INT,
     "EMPLOYEEID" INTEGER CS_INT,
     "ORDERDATE" LONGDATE CS_LONGDATE,
     "REQUIREDDATE" LONGDATE CS_LONGDATE,
     "SHIPPEDDATE" LONGDATE CS_LONGDATE,
     "PROMOTION_ID" INTEGER CS_INT,
     "PERIODID" INTEGER CS_INT,
     "DELIVEREDDATE" LONGDATE CS_LONGDATE,
     PRIMARY KEY ("ORDERID"));

 

准备相应的CSV文件:

image

 

准备CTL文件:

image

import data
into table "STUDENT44"."CUSTOMER"
from 'STS_CUSTOMER.csv'
    record delimited by '\n'
    field delimited by ','
    optionally enclosed by '"'
error log 'XTRA_STS_CUSTOMER.err'

 

上传文件到服务器相应的目录

 

在SQL Editor中运行以下语句:

IMPORT FROM '/backup/STS/STS_CUSTOMER.ctl';
UPDATE STUDENT44.CUSTOMER MERGE DELTA INDEX;

posted on 2013-04-17 10:22  沧海-重庆  阅读(509)  评论(0编辑  收藏