Oracle sqlldr 如何导入一个日期列

1.

LOAD DATA
INFILE *
INTO TABLE test
FIELDS TERMINATED BY X'9'
TRAILING NULLCOLS
(
    c2 "upper(:c2)",
    c3 date "yyyymmdd",
    c1 "SEQ_test_c1.nextval"
)
BEGINDATA
AAAAAAAAAA 20051201
BBBBBBBBBB 20050112

CREATE   TABLE  TEST
(
    C1 
VARCHAR2 ( 10  BYTE),
    C2 
VARCHAR2 ( 20  BYTE),
    C3 DATE
);

CREATE  SEQUENCE VV_USER.SEQ_TEST_C1
START 
WITH   0
MAXVALUE 
9999999
MINVALUE 
0
NOCYCLE
NOCACHE
NOORDER;

 

2.

LOAD DATA
INFILE *
INTO TABLE test
FIELDS TERMINATED BY X'9'
TRAILING NULLCOLS
(
    c2 "upper(:c2)",
    c3 "to_date(:c3,'yyyy-mm-dd')",
    c1 "SEQ_test_c1.nextval"
)
BEGINDATA
AAAAAAAAAA 2005-12-01
BBBBBBBBBB 2005-01-12

 

sqlldr user/passwd control = load_date.ctl 

©️2020 CSDN 皮肤主题: 深蓝海洋 设计师:CSDN官方博客 返回首页