Re: Problem with MySQL cursor
- From: "J. Clifford Dyer" <jcd@xxxxxxxxxxxxxxxx>
- Date: Thu, 11 Oct 2007 09:24:50 -0400
On Thu, Oct 11, 2007 at 03:14:30PM +0200, Florian Lindner wrote regarding Problem with MySQL cursor:
Traceback (most recent call last):
File "manage.py", line 90, in ?
addDomain(domainName)
File "manage.py", line 27, in addDomain
executeSQL(sql, DOMAIN_TABLE, DOMAIN_FIELD, domainname)
File "manage.py", line 22, in executeSQL
cursor.execute(sql, args)
File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 163, in
execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line 35,
in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1064, "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 ''domains' ('domain') VALUES ('xgm.de')' at
line 1")
I see the error: 2 opening quotes but only 1 closing around domains. But
where do they come from?
Note that there are no quotes at print sql % args.
No, there are no double quote issues. The first quote is provided by the error message, and is paired with the quote after the closed parenthesis in ('xgm.de')'. It is not part of your SQL.
Cheers,
Cliff
.
- References:
- Problem with MySQL cursor
- From: Florian Lindner
- Problem with MySQL cursor
- Prev by Date: Re: Fwd: NUCULAR fielded text searchable indexing
- Next by Date: Re: matching a street address with regular expressions
- Previous by thread: Problem with MySQL cursor
- Next by thread: RE: Problem with MySQL cursor
- Index(es):
Relevant Pages
|