SQLXMLBULKLOAD mapping file

  • Hi,

    I tried SQLXMLBulkLoad option by creating the mapping file and VB script, its not giving any error when I run the VB script and not loading the data into temp table.Here is my mapping file and VB script. How to map the attribute value job id into sql field along with cycle_no and pdm elements

    and How to map the hard coded table name to sql:relation valueÉ

    Customers.xml :

    <?xml version="1.0" ?>

    <batch>

    <job id="100360003">

    <cycle_no type="string">36</cycle_no>

    <PDM type="string">C</PDM>

    </job>

    <job id="100360004">

    <cycle_no type="string">36</cycle_no>

    <PDM type="string">C</PDM>

    </job>

    </batch>

    Customermapping.xml :

    <?xml version="1.0" ?>

    <Schema xmlns="urn:schemas-microsoft-com:xml-data"

    xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"

    xmlns:sql="urn:schemas-microsoft-com:xml-sql" >

    <AttributeType name="Id" />

    <ElementType name="Cycle_no" dt:type="string" />

    <ElementType name="PDM" dt:type="string" />

    <ElementType name="batch" sql:is-constant="1">

    </ElementType>

    <ElementType name="job" sql:relation="temp_xml">

    <attribute type="Id" sql:field="Id" />

    <element type="Cycle_no" sql:field="Cycle_no" />

    <element type="PDM" sql:field="PDM" />

    </ElementType>

    </Schema>

    Insertcustomers.vbs

    Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")

    objBL.ConnectionString = "provider=XXXXXXXX;data source=XXXXXXXX;database=XXXXXX;uid=XXXXXX;pwd=XXXXX"

    objBL.ErrorLogFile = "c:\error.log"

    objBL.Execute "c:\customermapping.xml", "c:\customers.xml"

    Set objBL = Nothing

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply