我正在分析通过SQL * Loader加载XML数据的问题。
问题是文件内容是否可变:
<customer>
<name>abc</name>
<surname>abc</surname>
<address>abc</address>
</customer>
<customer>
<name>abc</name>
<address>abc</address>
</customer>
如果找不到姓氏节点,则未加载记录,日志文件显示
Record 1: Rejected - ...Initial enclosure character not found
如果找不到标记,我想使用默认值。 “null if”不起作用。我怎么能这样做?
这是我的控制文件:
FIELDS (
dummy1 filler terminated by "<customer>",
name enclosed by "<name>" and "</name>",
surname enclosed by "<surname>" and "</surname>" NULLIF (surname = "unknown"),
address enclosed by "<address>" and "</address>",
dummy2 filler terminated by "</customer>"
)