0

i use a exporter for some mysql data. At first it will create the table and after that insert the data into it.

Example Code

    DROP TABLE IF EXISTS `dbc_Item-data`;
CREATE TABLE `dbc_Item-data` (
    `id` INT NOT NULL DEFAULT '0',
    `field97` INT NOT NULL DEFAULT '0',
    `field98` INT NOT NULL DEFAULT '0',
    `field99` INT NOT NULL DEFAULT '0',
    `field100` INT NOT NULL DEFAULT '0',
    `field101` INT NOT NULL DEFAULT '0',
)

The Result was a Mysql Syntax Error, - after some research i found that the , before the last line will stop him from importing. So because my exporter is done via c++ i can't change currently this (also i can't write c), so my question is: Is there any workarround in the serverconf for this? I rather would like not to change every .sql file via an editor.

Sincerly Yours from Germany Jonathan

1 Answer 1

1

Given that the output is programmatically generated, I assume that the syntax error is entirely regular. In that case, you can almost certainly solve the problem by replacing the string ,\n) with ), using a scripting solution of your choice (sed, perl, or whatever else butters your muffin).

1
  • Okay this is a good idea, even better as do this everytime by hand :) Thank you Aug 16, 2015 at 1:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .