Re: Problem with MySQL cursor



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
.



Relevant Pages

  • Re: IE 6.0 - Browser Freezes - Any Ideas?
    ... which then makes the error message about a "hungapp". ... Hi Maurice. ... </end quote> ... MVP Windows - Shell / User ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Microsoft Excel and Word Help
    ... When you click OK in the error message, ... You do not have access to the folder 'drive:\'. ... Locate the files through My Computer or Windows Explorer. ...
    (microsoft.public.windowsxp.newusers)
  • Re: Reduce double space after a comma and quote [,"] to a single space
    ... the Word help. ... Also finding instances of full stop and quote. ... field range is the error message from memory ... google this group for wildcard search replace and my name - this url is ...
    (microsoft.public.mac.office.word)
  • Re: How do format a SQL Insert Statement
    ... > The following Insert statement gives me an error message when the last ... Public Function QuoteTextAs String ... ' this is single quote character for ADO/ SQL Server ... Dim strTemp As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: IE 6.0 - Browser Freezes - Any Ideas?
    ... task manager b/c IE doesn't respond, which then makes the error message ... Hi Maurice. ... </end quote> ... MVP Windows - Shell / User ...
    (microsoft.public.windows.inetexplorer.ie6.browser)