Load XML data problem?

You are viewing an old version of this article. View the current version here.

Hello, I have problems with a xml file upload to mariadb 5.5

can u give me an error, but I want to hear other people's opinion and you can solve my problem. using manual and forums, I can not now load data into the database, but do the instructions, it may be some kind of mistake?

MyISAM table:

CREATE TABLE IF NOT EXISTS `test_xml` ( `id_article` varchar(20) NOT NULL, `group` varchar(20) NOT NULL, `auto` varchar(20) NOT NULL, `brand` varchar(30) NOT NULL, `number` varchar(25) NOT NULL, `original` varchar(50) NOT NULL, `descr` varchar(100) NOT NULL, `price` varchar(20) NOT NULL, `supplier` varchar(30) NOT NULL, `deadline` varchar(10) NOT NULL, `rest` varchar(10) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

XML: <articles> <article> <id_article>3</id_article> <group>group_text</group> <auto>name_auto</auto> <brand>brand_name</brand> <number>brand_nnnnuu</number> <original>o312</original> <descr>my description</descr> <price>123</price> <supplier>data123</supplier> <deadline>data321</deadline> <rest>23</rest> </article> </articles>

SQL: LOAD DATA local infile 'test.xml' into table `test_xml` CHARACTER SET utf8 ROWS IDENTIFIED BY '<article>'

i have only first column, but his not correct:

&lt;id_article&gt;3&lt;/id_| | | | | | | | | | | &lt;id_article&gt;4&lt;/id_| | | | | | | | | | | &lt;id_article&gt;7&lt;/id_| | | | | | | | | | | &lt;id_article&gt;9&lt;/id_| | | | | | | | | |

this link says my xml format can be accepted and my table have original columt as file. https://dev.mysql.com/doc/refman/5.5/en/load-xml.html

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.