0

I am using SQLXMLBULKLOAD library to load a xml file using a xsd. Below is the section from XSD.

<xsd:element name="Information" sql:is-constant="1">
  <xsd:complexType>
    <xsd:sequence>                                                              
      <xsd:element name="E_Code" type="xsd:string" sql:is-constant="1"/>                                                                
      <xsd:element name="E_Amount" type="xsd:string" minOccurs="0" sql:field="Amount_Paid"/>
      <xsd:element name="E_Quantity" nillable="true" minOccurs="0" sql:is-constant="1"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>.

The Element "Information" shown above can occur 10 times and i need to check if 'E_Code' = "xxxx" then only consider information block & E-Amount to bulk load otherwise proceed to the next information block for same condition check. Is it possible to do this in the schema file?

Please Help

KKR
  • 79
  • 8

1 Answers1

0

XSD is a language for defining validity conditions on XML documents; it's not designed as a way to control the behavior of database loaders, and it would be surprising if you could control the behavior of a loader by changes to the XSD schema.

C. M. Sperberg-McQueen
  • 24,596
  • 5
  • 38
  • 65
  • Thanks Sperberg. But what is the Best way to allow Bulk loader to load a specfic xml block based on some conditions? Thanks in advance – KKR Oct 28 '13 at 23:26
  • If the loader can be configured in the way you describe, I'd expect to see something useful in the loader documentation. From your description, what you're looking for is a way to control the loader, not a way to define validity of your input. So look to the loader, not to the schema, for your mechanism. – C. M. Sperberg-McQueen Oct 30 '13 at 16:45