Results 1 to 1 of 1

Thread: xmlbulk load

  1. #1
    Join Date
    Apr 2004
    Posts
    12

    Unanswered: xmlbulk load

    Hi
    I am trying to do an xmlbulk load into 2 related tables. Schema is as below
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
    <xsd:annotation>
    <xsd:appinfo>
    <sql:relationship name="t_input_file_hdr_t_input_file" parent="t_input_file" parent-key="record_id" child="t_input_data_hdr" child-key="file_record_id"/>
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:element name="tax_data">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="file_header" sql:relation="t_input_file" >
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="input_year" sql:field="input_year" type="xsd:string"/>
    <xsd:element name="batch_num" sql:field="batch_num" type="xsd:string"/>
    <xsd:element name="file_ver" sql:field="file_ver" type="xsd:float"/>
    <xsd:element name="hdr_seq_num" sql:field="hdr_seq_num" type="xsd:float"/>
    <xsd:element name="file_creation_date" sql:field="file_creation_date" type="xsd:string"/>
    <xsd:element name="source_system" sql:field="source_system"/>
    <xsd:element name="hdr_tax_reporting_type" sql:field="hdr_tax_reporting_type" type="xsd:string"/>
    <xsd:element name="tax_reporting_scheme" sql:field="tax_reporting_scheme" type="xsd:string"/>
    <xsd:element name="it_email" sql:field="it_email" type="xsd:string"/>

    <xsd:element name="data_header" sql:relation="t_input_data_hdr" sql:relationship="t_input_file_hdr_t_input_file">
    <xsd:complexType>
    <xsd:all>
    <xsd:element name="input_year" sql:field="input_year" type="xsd:string"/>
    <xsd:element name="invoice_num" sql:field="invoice_num" type="xsd:string"/>
    <xsd:element name="invoice_date" sql:field=" invoice_date" type="xsd:string"/>
    <xsd:element name="trading_part_name" sql:field="trading_part_name" type="xsd:string"/>
    <xsd:element name="credit_application_num" sql:field="credit_application_num" type="xsd:string"/>
    <xsd:element name="currency_code" sql:field="currency_code" type="xsd:string"/>
    <xsd:element name="comment" sql:field="comment" type="xsd:string"/>
    <xsd:element name="tax_reporting_type" sql:field="tax_reporting_type" type="xsd:string"/>
    <xsd:element name="post_period" sql:field="post_period" type="xsd:string"/>
    </xsd:all>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>


    The data that i am trying to load is
    <?xml version="1.0"?>
    <tax_data>

    <file_header>
    <input_year>2004</input_year>
    <file_ver>1.0</file_ver>
    <hdr_seq_num>1</hdr_seq_num>
    <file_creation_date>200403300000</file_creation_date>
    <source_system>BAF</source_system>
    <hdr_tax_reporting_type>OSB</hdr_tax_reporting_type>
    <tax_reporting_scheme>B</tax_reporting_scheme>
    <it_email>marilyn.ebert@gecapital.com</it_email>
    <data_header>
    <input_year>2004</input_year>
    <invoice_num>999770-1365896-002</invoice_num>
    <invoice_date>20030202</invoice_date>
    <trading_part_name>Country Discounter</trading_part_name>
    <credit_application_num/>
    <currency_code>USD</currency_code>
    <comment>QLOAN</comment>
    <tax_reporting_type>OSB</tax_reporting_type>
    <post_period>200403</post_period>
    </data_header>
    <data_header>
    <input_year>2004</input_year>
    <invoice_num>99977096-002</invoice_num>
    <invoice_date>20030202</invoice_date>
    <trading_part_name>Countcounter</trading_part_name>
    <credit_application_num/>
    <currency_code>USD</currency_code>
    <comment>QLOAN</comment>
    <tax_reporting_type>OSB</tax_reporting_type>
    <post_period>200303</post_period>
    </data_header>

    </file_header>

    </tax_data>

    I am getting the following error during the load : "Schema mapping: Schema: relationship expected on 'file_header' ."

    the record_id in t_input_file is an identity column
    I have no clue why i am getting this error. Any help is very much appreciated

    thankx
    Last edited by web7junkie; 04-12-04 at 14:46.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •