Gossamer Forum
Home : Products : Others : MySQLMan :

error in your SQL syntax near ')' at line 7.

Quote Reply
error in your SQL syntax near ')' at line 7.
Hello all,

When i try to import from a field with selected fields on and local file off i get a error.

Error

MySQL said: You have an error in your SQL syntax near ')' at line 7.

Query: LOAD DATA INFILE '<'...mypath:)>/cgi-bin/admin/testexcel.tab' IGNORE INTO TABLE Links FIELDS TERMINATED BY
'\\t' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES ()


Question 1: Is there a bug when you try to import with selected fields or something else ?

Note: when i give a none existing filename it display the same error !

Question 2: Is the record delimter \n when i use a exported excel file .tab or something else (") ?

Regards Startpoint.
Quote Reply
Re: error in your SQL syntax near ')' at line 7. In reply to
Whomever is working on the program may have to answer this. I really haven't figured out the program fully yet, it's using a different logic from Links SQL, more like the logic of the next version, and I'm soooo confused :}

But, it looks like a bug in the query. You've double escaped the \\t, and it doesn't seem to be parsing the input properly. So, it's probably in the input parser where I've hit a bug or two in the past.

I haven't tried this sort of import, but I did hit some other quirks that were similar. I don't know enough about the internals yet to say for sure, but it looks like a bug.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: error in your SQL syntax near ')' at line 7. In reply to
Yes, this is a bug in MySQLMan. Thank you for point it out. This will be fixed in the next release. For now, you can easily fix the bug by replacing the following lines in sub import_record in mysql.cgi:
Code:
1. Replace the line
my @select_fields = $in->param('right');

with
my @select_fields = $in->param('ImportRight');
Code:
2. Replace the line
$delimiter_q = $dbh->quote($delimiter);

with
$delimiter_q = "'" . $delimiter . "'";
Cheers,

--
Gossamer Threads, Inc.
Quote Reply
Re: error in your SQL syntax near ')' at line 7. In reply to
Please note that for users using version 1.02, the first step can be ignored.

--
Gossamer Threads, Inc.
Quote Reply
Re: error in your SQL syntax near ')' at line 7. In reply to
Pugdog thanks for your reply !


Hello Steven,

Thanks for the quick fix. But what did i win ?
Ah... a free livetime registration on mysqlman eh ? Smile

Tip: Well i would be great if you make a new function for importing data.

This function can save all the data (settings) you entered when you are import a file.
Like all selected fields and the rest of the settings. Now you have to re-enter it over and over again when you import.

Regards Startpoint

Quote Reply
Re: error in your SQL syntax near ')' at line 7. In reply to
i am version 1.3 user and i have changed only the second step thing mention by u above but i still get the error message
Please help

Best Regs
JackofNone

Quote Reply
Re: error in your SQL syntax near ')' at line 7. In reply to
I, too, am using version 1.03 and am getting the "parse error near ')' at line 7" error message. I've tried the fix listed above (both with and without step 1). Any other suggestions?

Thanks!

Melanie
http://www.somemoorecats.com/
http://www.okhima.org/