Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > What did I miss? XML bulk load
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 3rd May 02:16
sam
External User
 
Posts: 1
Default What did I miss? XML bulk load



Hello everyone,

Cannot I bulk load the following?

<Customer id = ¡°John¡±>

<city>New York</city>

<order id =o123 />

<order id =o124 />

</Customer >

<Customer id = ¡°Tom¡±>

<city>LA</city>

<order id =o125 />

<order id =o126 />

</Customer >

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:complexType>

<xsd:sequence>

<xsd:element name="city" type="xsd:string" />

<xsd:element name="order" >

<xsd:complexType>

<xsd:attribute name="ID"

sql:relation="order"

sql:relationship="custorder"

type="xsd:string" />

</xsd:complexType>

</xsd:element>

</xsd:sequence>

<xsd:attribute name="ID" type="xsd:string" />

</xsd:complexType>

</xsd:element>

error message: the relationship custorder referred to in the node 'ID' is
not defined
  Reply With Quote


  sponsored links


2 3rd May 02:16
vinodk
External User
 
Posts: 1
Default What did I miss? XML bulk load



I think you post the same in the XML newsgroups ...

--
HTH,
Vinod Kumar
MCSE, DBA, MCAD
http://www.extremeexperts.com/
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666