3rd May 02:16
What did I miss? XML bulk load
Cannot I bulk load the following?
<Customer id = ¡°John¡±>
<order id =o123 />
<order id =o124 />
<Customer id = ¡°Tom¡±>
<order id =o125 />
<order id =o126 />
I believe it¡¯s a common problem, anybody may encounter it.
Well, it¡¯s a simple relationship, each customer can place many order,
Use XML bulk load to insert it into two tables: Customer & Order
Bulk load is working on kind of ¡°scan-based¡± mode,
At </order>, it will insert to the order table, it need the customer¡¯s
id as its foreign key, however, the customer id has not defined at
that point of the time. It¡¯s an attribute, not a subelement of the
product, THE ATTRIBUTE HAVE TO BE FOLLOWED BY
</xsd:sequence>. That means the order element has to be ahead
of customer id which is a key info order element need to get?
<xsd:element name="Customer" sql:relation="Cust">
<xsd:element name="city" type="xsd:string" />
<xsd:element name="order" >
<xsd:attribute name="ID" type="xsd:string" />
error message: the relationship custorder referred to in the node 'ID' is