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:
I can't figure out why the highlighted rows above are appearing?
Using version 8.0.17
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.
Comments