Question

I downloaded the Stack Overflow data dump as XML files. Then I converted the XML files into SQL files. I tried to use the SQL file containing all the post data and import it to my MySQL database. However, when doing that, I get the following error message:

RROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1

I looked at my posts.sql file and I can't find a syntax error. Here are the first 30 lines of the posts.sql file:

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;

What is wrong with it?

Was it helpful?

Solution

You insert values list is incorrect(need to remove last comma)

... values("val", "val",)

fix it to:

... values("val", "val")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top