我以XML文件的形式下载了堆栈溢出数据转储。然后,我将XML文件转换为SQL文件。我尝试使用包含所有post数据的SQL文件并将其导入我的MySQL数据库。但是,在这样做时,我会收到以下错误消息:
RROR 1064 (42000)在第1行:您的SQL语法出现错误;请检查与您的MySQL服务器版本对应的手册,以获得在第1行使用的正确语法
我查看了我的posts.sql文件,找不到语法错误。下面是posts.sql文件的前30行:
insert into posts(Body, ViewCount, LastActivityDate, Title, LastEditorUserId,
LastEditorDisplayName, LastEditDate, CommentCount,
AnswerCount, AcceptedAnswerId, Score, CommunityOwnedDate,
PostTypeId, OwnerUserId, Tags, CreationDate, FavoriteCount, Id)
values
(
"<p>I want to use a track-bar to change a form\'s opacity.</p>
<p>This is my code:</p>
<pre><code>decimal trans = trackBar1.Value / 5000;
this.Opacity = trans;
</code></pre>
<p>When I try to build it, I get this error:</p>
<blockquote>
<p>Cannot implicitly convert type \'decimal\' to \'double\'.</p>
</blockquote>
<p>I tried making <strong>trans</strong> to <strong>double</strong>, but then the control doesn\'t work. This code has worked fine for me in VB.NET in the past. </p>",
"15207",
"2014-01-03T02:42:54.963",
"When setting a form\'s opacity should I use a decimal or double?",
"2648239",
"Rich B",
"2014-01-03T02:42:54.963",
"25",
"13",
"7",
"251",
"2012-10-31T16:42:47.213",
"1",
"8",
"<c#><winforms><forms><type-conversion><opacity>",
"2008-07-31T21:42:52.667",
"23",
"4",
);
insert into posts(Body, ViewCount, LastActivityDate, Title, LastEditorUserId,
LastEditorDisplayName, LastEditDate, CommentCount, AnswerCount,
AcceptedAnswerId, Score, PostTypeId, OwnerUserId, Tags,
CreationDate, FavoriteCount, Id)
values
(
"<p>I have an absolutely positioned <code>div</code> containing several children, one of which is a relatively positioned <code>div</code>. When I use a percentage-based width on the child <code>div</code>, it collapses to <code>0</code> width on IE7, but not on Firefox or Safari. </p>
<p>If I use pixel width, it works. If the parent is relatively positioned, the percentage width on the child works. </p>
<p>Is there something I\'m missing here?
Is there an easy fix for this besides the pixel-based width on the child?
Is there an area of the CSS specification that covers this?</p>",
"8524",
"2013-11-20T04:16:38.813",
"Why doesn\'t the percentage width child in absolutely positioned parent work",
"243557",
"Rich B",
"2013-10-04T01:14:10.373",
"12",
"5",
"31",
"121",
"1",
"9",
"<html><css><css3><internet-explorer-7>",
"2008-07-31T22:08:08.620",
"7",
"6",
);
insert into posts(Body, LastActivityDate, LastEditorUserId, PostTypeId, LastEditDate,
CommentCount, Score, ParentId, OwnerUserId, CreationDate, Id)
values (
"<p>An explicit cast to double isn\'t necessary.</p>
<pre><code>double trans = (double)trackBar1.Value / 5000.0;
</code></pre>
<p>Identifying the constant as <code>5000.0</code> (or as <code>5000d</code>) is sufficient:</p>
<pre><code>double trans = trackBar1.Value / 5000.0;这是怎么回事?
发布于 2014-05-06 17:47:22
插入值列表不正确(需要删除最后一个逗号)
... values("val", "val",)将其修复为:
... values("val", "val")https://stackoverflow.com/questions/23501383
复制相似问题