Friday, February 24, 2012

Bulk Import XSD relationships and text data

The data looks like:
<designselection action="add">
<name>60945000010Scheme</name>
<selectionvalue action="add">01</selectionvalue>
<selectionvalue action="add">02</selectionvalue>
<selectionvalue action="add">03</selectionvalue>
</designselection>
We are trying to bulk Load data and we have encountered a
problem when loading the schema cache. We can get the
attribute action just fine and we can even get the name
element. The selectionvalue node is mapped using a
relationship withe the name as the key. The problem is
that when we want to get the text we get an error. The
XSD looks like the below. The part that isn't working is
the 'type="xsd:string" sql:field="value"
sql:datatype="varchar(50)"' on the '<xsd:element
name="selectionvalue"' line. How do we get the text data?
XSD pasted here
<xsd:element name="designselection" minOccurs="0"
sql:relation="_import_tblplanoptionselectionattrib ute"
sql:overflow-field="overflow_field"
sql:relationship="FK_tblplanoptionselectionattribu te_tblpl
anoptionselection">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="phasecode"
type="xsd:string" sql:field="phasecode"
sql:datatype="varchar(50)"/><!-- Inherit from previous. --
>
<xsd:element name="plancode"
type="xsd:string" sql:field="plancode"
sql:datatype="varchar(50)"/><!-- Inherit from previous. --
>
<xsd:element name="optioncode"
type="xsd:string" sql:field="optioncode"
sql:datatype="varchar(50)"/><!-- Inherit from previous. --
>
<xsd:element name="name"
type="xsd:string" sql:field="attributecode"
sql:datatype="varchar(50)"/>
<xsd:element
name="selectionvalue" type="xsd:string" sql:field="value"
sql:datatype="varchar(50)" minOccurs="0"
sql:relation="_import_tblplanoptionselectionattrib utevalue
" sql:overflow-field="overflow_field"
sql:relationship="FK_tblplanoptionselectionattribu tevalue_
tblplanoptionselectionattribute">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="phasecode" type="xsd:string"
sql:field="phasecode" sql:datatype="varchar(50)"/><!--
Inherit from previous. -->
<xsd:element name="plancode" type="xsd:string"
sql:field="plancode" sql:datatype="varchar(50)"/><!--
Inherit from previous. -->
<xsd:element name="optioncode" type="xsd:string"
sql:field="optioncode" sql:datatype="varchar(50)"/><!--
Inherit from previous. -->
<xsd:element name="attributecode"
type="xsd:string" sql:field="attributecode"
sql:datatype="varchar(50)"/><!-- Inherit from previous. --
>
</xsd:sequence>
<xsd:attribute
name="action" type="xsd:string" use="required"
sql:field="action" sql:datatype="varchar(50)"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="action"
type="xsd:string" use="required" sql:field="action"
sql:datatype="varchar(50)"/>
</xsd:complexType>
</xsd:element>
What is the error you are getting?
Irwin Dolobowsky
Program Manager, SqlXml
http://msdn.microsoft.com/xml
This posting is provided "AS IS" with no warranties, and confers no rights.
"Karl Snyder" <anonymous@.discussions.microsoft.com> wrote in message
news:0cdd01c4e135$82d9bac0$a501280a@.phx.gbl...
> The data looks like:
> <designselection action="add">
> <name>60945000010Scheme</name>
> <selectionvalue action="add">01</selectionvalue>
> <selectionvalue action="add">02</selectionvalue>
> <selectionvalue action="add">03</selectionvalue>
> </designselection>
> We are trying to bulk Load data and we have encountered a
> problem when loading the schema cache. We can get the
> attribute action just fine and we can even get the name
> element. The selectionvalue node is mapped using a
> relationship withe the name as the key. The problem is
> that when we want to get the text we get an error. The
> XSD looks like the below. The part that isn't working is
> the 'type="xsd:string" sql:field="value"
> sql:datatype="varchar(50)"' on the '<xsd:element
> name="selectionvalue"' line. How do we get the text data?
> --
> XSD pasted here
> <xsd:element name="designselection" minOccurs="0"
> sql:relation="_import_tblplanoptionselectionattrib ute"
> sql:overflow-field="overflow_field"
> sql:relationship="FK_tblplanoptionselectionattribu te_tblpl
> anoptionselection">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="phasecode"
> type="xsd:string" sql:field="phasecode"
> sql:datatype="varchar(50)"/><!-- Inherit from previous. --
> <xsd:element name="plancode"
> type="xsd:string" sql:field="plancode"
> sql:datatype="varchar(50)"/><!-- Inherit from previous. --
> <xsd:element name="optioncode"
> type="xsd:string" sql:field="optioncode"
> sql:datatype="varchar(50)"/><!-- Inherit from previous. --
> <xsd:element name="name"
> type="xsd:string" sql:field="attributecode"
> sql:datatype="varchar(50)"/>
> <xsd:element
> name="selectionvalue" type="xsd:string" sql:field="value"
> sql:datatype="varchar(50)" minOccurs="0"
> sql:relation="_import_tblplanoptionselectionattrib utevalue
> " sql:overflow-field="overflow_field"
> sql:relationship="FK_tblplanoptionselectionattribu tevalue_
> tblplanoptionselectionattribute">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="phasecode" type="xsd:string"
> sql:field="phasecode" sql:datatype="varchar(50)"/><!--
> Inherit from previous. -->
> <xsd:element name="plancode" type="xsd:string"
> sql:field="plancode" sql:datatype="varchar(50)"/><!--
> Inherit from previous. -->
> <xsd:element name="optioncode" type="xsd:string"
> sql:field="optioncode" sql:datatype="varchar(50)"/><!--
> Inherit from previous. -->
> <xsd:element name="attributecode"
> type="xsd:string" sql:field="attributecode"
> sql:datatype="varchar(50)"/><!-- Inherit from previous. --
> </xsd:sequence>
> <xsd:attribute
> name="action" type="xsd:string" use="required"
> sql:field="action" sql:datatype="varchar(50)"/>
> </xsd:complexType>
> </xsd:element>
> </xsd:sequence>
> <xsd:attribute name="action"
> type="xsd:string" use="required" sql:field="action"
> sql:datatype="varchar(50)"/>
> </xsd:complexType>
> </xsd:element>

No comments:

Post a Comment