February 17, 2005 at 3:02 am
Hello,
I have a table with a large number of columns and the destination schema requires me to group the columns to sub-elements like this:
<Parent (bound to table MyParent)>
<SubElemA col1="..." col2="..." />
<SubElemB col3="..." col4="..." col5="..." />
</Parent>
The default mapping mechanism for child-elements with a complexType obviously requests a "SubElemA" table. An explicit relation would consist of a "self-join"-relationship on table MyParent for each of the sub-elements. Or is there some magic sql:relation="__useParent" which I have overlooked?
<xsd:annotation><xsd:appinfo>
<sql:relationship name="MyParentMyParent"
parent="MyParent" parent-key="MyKey"
child="MyParent" child-key="MyKey" />
</xsd:appinfo></xsd:annotation>
<xsd:element name="Parent" sql:relation="Parent">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SubElemA" sql:relation="MyParent"
sql:relationship="MyParentMyParent">
<xsd:complexType>
<xsd:attribute name="col1" type="xsd:string" />
<xsd:attribute name="col2" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="SubElemB" sql:relation="MyParent"
sql:relationship="MyParentMyParent">
<xsd:complexType>
<xsd:attribute name="col3" type="xsd:string" />
<xsd:attribute name="col4" type="xsd:string" />
<xsd:attribute name="col5" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Does SQLXML actually convert this into a join or is it smart enough take the values from the parent table?
Thanks for any advice
Andreas
February 21, 2005 at 8:00 am
This was removed by the editor as SPAM
February 26, 2005 at 1:49 pm
its not clear to me how you are trying to do this. If you are still looking for an answer can you please indicate if you are trying to query this out with for xml?
thanks
March 10, 2005 at 9:19 pm
Use XDR Annotated schema. Use XML View Mapper and then filter the requirements. Sorry for not offering a specific help but a pointer.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply