Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7749231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:59:28+00:00 2026-06-01T10:59:28+00:00

I am completely new in MySQL and trying to insert multiple rows in MySQL

  • 0

I am completely new in MySQL and trying to insert multiple rows in MySQL table using XMl file but can’t do it.
My query gets executed successfully but when inserts null in columns in table. Below is the code for query and XML file.

set @xml := load_file('c:/xmldistributortransaction.xml');
insert into xmldistributortransaction     (DistributorId,ProductId,Remarks,Quantity,Price,DIscount,TaxName,Total,AddedDate) values (
        extractValue(@xml,'/resultset/row[1]/field[1]/text()'),
        extractValue(@xml,'/resultset/row[1]/field[2]/text()'),
  extractValue(@xml,'/resultset/row[1]/field[3]/text()'),
  extractValue(@xml,'/resultset/row[1]/field[4]/text()'),
        extractValue(@xml,'/resultset/row[1]/field[5]/text()'),
        extractValue(@xml,'/resultset/row[1]/field[6]/text()'),
        extractValue(@xml,'/resultset/row[1]/field[7]/text()'),
        extractValue(@xml,'/resultset/row[1]/field[8]/text()'),
        extractValue(@xml,'/resultset/row[1]/field[9]/text()'));

XML file

<?xml version="1.0"?>
<resultset statement="select      DistributorId,ProductId,Remarks,Quantity,Price,DIscount,TaxName,Total,AddedDate from xmldistributortransaction">
<row>
<field name="DistributorId">2</field>
<field name="ProductId">20 </field>
<field name="Remarks">remarks for second</field>
<field name="Quantity" >300</field >
<field name="Price">30</field>
<field name="Discount">2 </field>
<field name="TaxName">VAT4</field>
<field name="Total">240</field>
<field name="AddedDate">2012-04-02</field>
</row>
</resultset>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:59:30+00:00Added an answer on June 1, 2026 at 10:59 am

    You can try LOAD XML (MySQL) command.

    LOAD XML statement syntax, added in MySQL 5.5.

    For example –

    LOAD XML LOCAL INFILE 'xmldistributortransaction.xml'
      INTO TABLE xmldistributortransaction
      ROWS IDENTIFIED BY '<row>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to MySQL and I'm trying to come up with a query
I'm trying to create a completely new database from an existing MySQL database, bringing
Disclaimer: I am completely new to PHP and MySQL/SQL. I have multiple implode() functions
I'm completely new to MySQL. I'm attempting to write a query that inserts a
I'm completely new to COBOL, but I'd like to take a look at the
I am completely new to flash. We need to load a binary file from
I'm completely new to MySql and haven't used SqlDataSource with UpdateParameters before, so I'm
Firstly, I should say I'm completely new to Pylons, trying to learn web development
I am trying to install the new version of the twitter-bootstrap-rails gem (v2), but
I'm trying to rewrite a SQL query in LINQ to Entities. I'm using LINQPad

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.