Loading XML file in MySQL getting extra rows

Gurmo

I've run this for other files and have never seen this before and can't tell what is happening.

Here is my table structure:

DROP TABLE IF EXISTS Searchword; COMMIT;
CREATE TABLE Searchword ( 
  id INT NOT NULL AUTO_INCREMENT
, SearchwordID int 
, ConceptID int 
, Searchword nvarchar(80)
, CreateDate datetime 
, LastDate datetime 
, LanguageID int 
, PRIMARY KEY (id) 
); COMMIT;

Here is my XML:

<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation="Searchword.xsd" generated="2020-10-09T10:05:52">
    <Searchword>
        <SearchwordID>1</SearchwordID>
        <ConceptID>1</ConceptID>
        <Searchword>Tacos</Searchword>
        <CreateDate>2020-07-15T09:45:34</CreateDate>
        <LastDate>2020-07-15T09:45:34</LastDate>
        <LanguageID>1</LanguageID>
    </Searchword>
    <Searchword>
        <SearchwordID>2</SearchwordID>
        <ConceptID>1</ConceptID>
        <Searchword>Beef Tacos</Searchword>
        <CreateDate>2020-07-15T09:42:50</CreateDate>
        <LastDate>2020-07-15T09:42:50</LastDate>
        <LanguageID>1</LanguageID>
    </Searchword>
    <Searchword>
        <SearchwordID>3</SearchwordID>
        <ConceptID>1</ConceptID>
        <Searchword>Tacos Supreme</Searchword>
        <CreateDate>2020-07-15T09:42:50</CreateDate>
        <LastDate>2020-07-15T09:42:50</LastDate>
        <LanguageID>1</LanguageID>
    </Searchword>
</dataroot>

My Load code:

LOAD XML LOCAL INFILE 'C:/filelocation/Searchword.xml' 
INTO TABLE Searchword 
ROWS IDENTIFIED BY '<Searchword>'; 
;COMMIT; 

But here are my results:

Results

I can't figure out why the highlighted rows above are appearing?

Using version 8.0.17

nbk

this is because you have

Searchword twice in your xml see where the ** are

**<Searchword>**
    <SearchwordID>1</SearchwordID>
    <ConceptID>1</ConceptID>
    **<Searchword>Tacos</Searchword>**
    <CreateDate>2020-07-15T09:45:34</CreateDate>
    <LastDate>2020-07-15T09:45:34</LastDate>
    <LanguageID>1</LanguageID>
</Searchword>

So the oarser thing that is alsao a row

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

loading content of XML file

From Dev

Getting XML file from another domain to Mysql database

From Dev

Loading Excel data into SQL server - Extra NULL Rows added

From Dev

Getting extra spaces in CodeIgniter MySQL query

From Dev

loading xml file to oracle table

From Dev

Loading NSDictionary parsing xml file

From Dev

Loading XML file into NodeJS as a JSON

From Dev

XHR not loading a XML local file

From Dev

loading xml file to stored procedure

From Dev

Getting extra line when output to file?

From Dev

Getting extra line when output to file?

From Dev

Javamail Getting one extra file On downloading attachments

From Dev

VBS Creating CSV file then adding extra rows to it

From Dev

MySQL grouping and getting newest rows

From Dev

Getting the most recent rows in mysql

From Dev

Merging Dataframes and getting extra rows. (Python/Pandas)

From Dev

Loading 5 million rows into Pandas from MySQL

From Dev

Duplicate Rows Loading Data From MySQL to DataGridView

From Dev

MySQL error loading data file

From Dev

Loading a file that specifies an error form, but getting the error

From Dev

Getting error in loading json from static file?

From Dev

Loading a file that specifies an error form, but getting the error

From Dev

Extra characters in XML file after XDocument Save

From Dev

why am I getting SAXparseException "Element type must be declared" eventhough it was declared while loading XML file to Properties Object?

From Dev

java.io.File getting extra char while writing into file

From Dev

PHP Generating XML, getting Extra content at the end of the document

From Dev

XML with PHP “echo” getting error “Extra content at the end of the document”

From Dev

Getting text whether or not nested inside an extra element when parsing XML

From Dev

Issues loading XML file data into a PHP object

Related Related

  1. 1

    loading content of XML file

  2. 2

    Getting XML file from another domain to Mysql database

  3. 3

    Loading Excel data into SQL server - Extra NULL Rows added

  4. 4

    Getting extra spaces in CodeIgniter MySQL query

  5. 5

    loading xml file to oracle table

  6. 6

    Loading NSDictionary parsing xml file

  7. 7

    Loading XML file into NodeJS as a JSON

  8. 8

    XHR not loading a XML local file

  9. 9

    loading xml file to stored procedure

  10. 10

    Getting extra line when output to file?

  11. 11

    Getting extra line when output to file?

  12. 12

    Javamail Getting one extra file On downloading attachments

  13. 13

    VBS Creating CSV file then adding extra rows to it

  14. 14

    MySQL grouping and getting newest rows

  15. 15

    Getting the most recent rows in mysql

  16. 16

    Merging Dataframes and getting extra rows. (Python/Pandas)

  17. 17

    Loading 5 million rows into Pandas from MySQL

  18. 18

    Duplicate Rows Loading Data From MySQL to DataGridView

  19. 19

    MySQL error loading data file

  20. 20

    Loading a file that specifies an error form, but getting the error

  21. 21

    Getting error in loading json from static file?

  22. 22

    Loading a file that specifies an error form, but getting the error

  23. 23

    Extra characters in XML file after XDocument Save

  24. 24

    why am I getting SAXparseException "Element type must be declared" eventhough it was declared while loading XML file to Properties Object?

  25. 25

    java.io.File getting extra char while writing into file

  26. 26

    PHP Generating XML, getting Extra content at the end of the document

  27. 27

    XML with PHP “echo” getting error “Extra content at the end of the document”

  28. 28

    Getting text whether or not nested inside an extra element when parsing XML

  29. 29

    Issues loading XML file data into a PHP object

HotTag

Archive