将 xml 本地文件“E:\Badges.xml”加载到由“”标识-6ren">
gpt4 book ai didi

mysql - "Load xml"在mysql中填充空值

转载 作者:行者123 更新时间:2023-11-30 23:15:14 25 4
gpt4 key购买 nike

我正在运行加载 xml 命令以将 xml 文件中的值填充到 mysql 表中,但它总是填充空值。

我正在运行以下命令:

mysql> 将 xml 本地文件“E:\Badges.xml”加载到由“<row>”标识的表元行中'

以下是我的文件内容:

<badges>
<row Id="1" UserId="2" Name="Autobiographer" Date="2010-08-25T19:26:49.550" />
<row Id="2" UserId="3" Name="Autobiographer" Date="2010-08-25T19:26:49.580" />
<row Id="3" UserId="6" Name="Autobiographer" Date="2010-08-25T19:46:49.197" />
<row Id="4" UserId="15" Name="Autobiographer" Date="2010-08-25T19:46:49.197" />
<row Id="5" UserId="18" Name="Autobiographer" Date="2010-08-25T19:46:49.197" />
<row Id="6" UserId="21" Name="Autobiographer" Date="2010-08-25T19:46:49.197" />
<row Id="7" UserId="27" Name="Autobiographer" Date="2010-08-25T19:46:49.213" />
<row Id="8" UserId="7" Name="Autobiographer" Date="2010-08-25T19:51:49.327" />
</badges>

请告诉我是否有人知道解决方案?

谢谢!提前桑吉塔

最佳答案

以下文件 badges.xml 适用于我(区分大小写):

<badges>
<row id="1" userid="2" name="Autobiographer" date="2010-08-25T19:26:49.550" />
<row id="2" userid="3" name="Autobiographer" date="2010-08-25T19:26:49.580" />
<row id="3" userid="6" name="Autobiographer" date="2010-08-25T19:46:49.197" />
<row id="4" userid="15" name="Autobiographer" date="2010-08-25T19:46:49.197" />
<row id="5" userid="18" name="Autobiographer" date="2010-08-25T19:46:49.197" />
<row id="6" userid="21" name="Autobiographer" date="2010-08-25T19:46:49.197" />
<row id="7" userid="27" name="Autobiographer" date="2010-08-25T19:46:49.213" />
<row id="8" userid="7" name="Autobiographer" date="2010-08-25T19:51:49.327" />
</badges>

LOAD XML INFILE '/path/badges.xml' INTO TABLE meta ROWS IDENTIFIED BY '<row>';

关于mysql - "Load xml"在mysql中填充空值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18192029/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com