我创建了表格
CREATE TABLE TEST2
(Seq varchar2(255 CHAR),
ID varchar2(255 CHAR),
NAME VARCHAR2 (255 CHAR),
DOB TIMESTAMP(3)
);
我的控制文件是
load data
infile 'C:\Users\sgujar\Documents\CDAR\test2.csv'
append into table TEST2
fields terminated by ","
(ID,
NAME,
DOB "TO_TIMESTAMP (:DOB, 'YYYY-MM-DD HH24:MI:SS.FF')",
seq"TEST2_seq.nextval"
)
我无法在sql loader中使用序列。
你能帮忙吗
答案 0 :(得分:0)
虽然不是一个特别漂亮的解决方案,但它可以满足您的要求:
CREATE OR REPLACE
FUNCTION get_test2_seq RETURN INTEGER
IS
BEGIN
RETURN TEST2_seq.nextval;
END;
/
然后您的控制文件将是
load data
infile 'C:\Users\sgujar\Documents\CDAR\test2.csv'
append into table TEST2
fields terminated by ","
(
ID,
NAME,
DOB "TO_TIMESTAMP (:DOB, 'YYYY-MM-DD HH24:MI:SS.FF')",
SEQ "get_test2_seq()"
)
答案 1 :(得分:0)
这肯定会奏效 options(DIRECT = TRUE,readsize = 4096000,bindsize = 4096000,skip = 1,errors = 1,rows = 50000) 负载数据 字符AL32UTF8长度语义特征 INFILE /path/test.csv'
BADFILE' /path/file.bad'
INSERT INTO TABLE test_table
FIELDS终止于","选择性地包括'''跟踪NULLCOLS
( Col1序列(1,1), Col2常数" N", )