Oracle SQL * Loader控制文件中的默认值

时间:2017-02-16 04:29:46

标签: oracle controlfile

我有一个SQL * Loader控制文件,用于将数据从XML文件传输到Oracle数据库。 我的控制文件如下:

options (errors=100,silent=feedback)
load data
infile "dest/TMP-TMP_Employee.xml" "str '</RECORD>'"
replace
into table "TMP_Employee"
TRAILING NULLCOLS
(
DUMMY filler terminated by "<RECORD>",
ID_EMP enclosed by "<ID_EMP>" and "</ID_EMP>",
ORIGINE enclosed by "<ORIGINE>" and "</ORIGINE>",
CODE_TYPE_ORDRE enclosed by "<CODE_TYPE_ORDRE>" and "</CODE_TYPE_ORDRE>",
CODE_STATUS enclosed by "<CODE_STATUS>" and "</CODE_STATUS>",
INDICATOR enclosed by "<INDICATOR>" and "</INDICATOR>"
)

我已向TMP_Employee添加了一个新列FULL_TIME,类型为VARCHAR2(1 BYTE)。
我需要在控制文件中添加列FULL_TIME,默认值为“0”。我把它添加如下:

options (errors=100,silent=feedback)
load data
infile "dest/TMP-TMP_Employee.xml" "str '</RECORD>'"
replace
into table "TMP_Employee"
TRAILING NULLCOLS
(
DUMMY filler terminated by "<RECORD>",
ID_EMP enclosed by "<ID_EMP>" and "</ID_EMP>",
ORIGINE enclosed by "<ORIGINE>" and "</ORIGINE>",
CODE_TYPE_ORDRE enclosed by "<CODE_TYPE_ORDRE>" and "</CODE_TYPE_ORDRE>",
CODE_STATUS enclosed by "<CODE_STATUS>" and "</CODE_STATUS>",
INDICATOR enclosed by "<INDICATOR>" and "</INDICATOR>",
IC_REMUNEREE DEFAULT 0
)

但这不起作用。知道如何正确地做到这一点吗?

0 个答案:

没有答案