August 11, 2011 at 3:23 pm
I get the following error when attempting to use the XML Bulk Load COM component:
Error: Schema: multiple base for a derived type on AgencyCommissionCurrentYearcalculated is not supported.
Code: 80004005
Source: Schema Mapping
I've simplified the XSD and XML files to the bare bones of what is causing the error to happen, but I can't identify what is wrong in the XSD to cause the problem. Unfortunately, I'm getting a bit frustrated, and I've got consultants here that can't figure it out either. I attached the three files that I'm using (you will need to modify the SQL server in the vbs file, but otherwise all code should run and generate the error for anyone willing to help.)
I'm almost positive the problem is with the XSD.
I've got a vbs file that looks like this:
set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.4.0")
objBL.ConnectionString = "provider=SQLOLEDB;data source=PUINYDW1;database=PureMapping;integrated security=SSPI"
objBL.ErrorLogFile = "error.log"
objBL.Execute "PartnerObjectSchema.xsd", "Partner.xml"
set objBL = Nothing
The XSD looks like this:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.test.com/myschema" targetNamespace="http://www.test.com/myschema" elementFormDefault="qualified">
<xsd:simpleType name="Monetary">
<xsd:union memberTypes="Mand_Monetary emptyString"/>
</xsd:simpleType>
<xsd:simpleType name="Mand_Monetary">
<xsd:restriction base="xsd:double"/>
</xsd:simpleType>
<xsd:simpleType name="emptyString">
<xsd:restriction base="xsd:string">
<xsd:enumeration value=""/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="Partner" type="Partner_Type" />
<xsd:complexType name="Partner_Type">
<xsd:sequence>
<xsd:element name="AgencyCommissionCurrentYearcalculated" minOccurs="0" nillable="true">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="Monetary">
<xsd:attribute name="os_bv_id" type="xsd:long" use="optional" fixed="43049414" />
<xsd:attribute name="ldt" type="xsd:long" use="optional" fixed="12" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="os_md_id" use="optional" type="xsd:long" fixed="2264714" />
<xsd:attribute name="os_st_id" use="optional" type="xsd:ID" />
</xsd:complexType>
<xsd:annotation>
<xsd:documentation>OneShield Proprietary. Do Not Distribute</xsd:documentation>
</xsd:annotation>
</xsd:schema>
To simplify the problem, I created a nearly empty XML data file:
<Partner os_md_id="2264314" os_st_id="ID3151879419" xmlns="http://www.oneshield.com/DragonSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></Partner>
Thanks in advance for anyone that can help.
August 12, 2011 at 7:08 am
Figured it out. It had to do with the fact that the bulk loader isn't pleased with the fact that the type Monetary was a union of two member types that had different base type restrictions. However, with the fact that I might sometimes receive a double and sometimes receive a string (technically, an empty string), I'm surprised this would be a problem anyway.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply