DB2导入(原始)XML数据

DB2导入(原始)XML数据,xml,import,db2,load,db2-luw,Xml,Import,Db2,Load,Db2 Luw,是否有方法将原始xml数据导入(或加载)到具有xml类型列的表中 <customerinfo Cid="1000"><name>Kathy Smith</name><addr country="Canada"><street>5 Rosewood</street><city>Toronto</city><prov-state>Ontario</prov-state><pc

是否有方法将原始xml数据导入(或加载)到具有xml类型列的表中

<customerinfo Cid="1000"><name>Kathy Smith</name><addr country="Canada"><street>5 Rosewood</street><city>Toronto</city><prov-state>Ontario</prov-state><pcode-zip>M6W 1E6</pcode-zip></addr><phone type="work">416-555-1358</phone></customerinfo>
<customerinfo Cid="1001"><name>Kathy Smith</name><addr country="Canada"><street>25 EastCreek</street><city>Markham</city><prov-state>Ontario</prov-state><pcode-zip>N9C 3T6</pcode-zip></addr><phone type="work">905-555-7258</phone></customerinfo>
...
DB2正确读取XML文件,但无法将其导入行中

Number of rows read = 6
Number of rows skipped = 0
Number of rows inserted = 0
Number of rows updated = 0
Number of rows rejected = 6
Number of rows = 6

有什么想法吗?

您需要一个DEL文件,其中包含在哪里可以找到XML文件的描述。尝试以下方法:

test.del:

<XDS FIL='test.xml' />

“MyTable”是包含XML列的表。有关更多示例,请参阅。

一个想法可能是检查实际的错误消息,准确解释拒绝这些行的原因。我基本上说它缺少xsd文件。是的,说没有导入原始xml数据的选项。。。但是谢谢。您可以导入原始XML,但需要通过CSV文件解决方案。我见过一些脚本,如果您只想导入XML数据,它们可以生成CSV。
<XDS FIL='test.xml' />
import from test.del OF DEL INSERT INTO MyTable