Schedule wrote: > Hello, > > I am currenty using MySQL 5.1 community server and trying to import the > data of the comma delimited text file into the table using python 2.6 > scripts. I have installed Mysqldb 1.2.2. > > follwoing is my script: > [...] > 7. > c.execute("INSERT INTO a (first, last) VALUES (%s, %s), row") > [...] > When I execute the statement I get the following error: > ------------------------------------------------------------------------------------ > [...] > _mysql_exceptions.ProgrammingError: (1064, "You have an error in your > SQL syntax; check the manual tha > t corresponds to your MySQL server version for the right syntax to use > near '%s, %s), row' at line 1")
You misplaced the closing quote. wrong: c.execute("INSERT INTO a (first, last) VALUES (%s, %s), row") correct: c.execute("INSERT INTO a (first, last) VALUES (%s, %s)", row) -- Gerhard -- http://mail.python.org/mailman/listinfo/python-list