_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQ L
syntax; right syntax to use near ')' at line 1")
Python MySQL Statement returning Error
def _conditional_insert(self, tx, item):
tx.execute('select * from table where text1 = %s', (item['text1'], ))
result = tx.fetchone()
if result:
log.msg("Item already stored in db: %s" % item, level=log.DEBUG)
else:
tx.execute(\
"INSERT INTO table (text3 table, text1, text2) "
"values (%s, %s, %s, %s)",
(item['text3'],
item['table'],
item['text1'],
item['text2'],
)
)
log.msg("Item stored in db: %s" % item, level=log.DEBUG)
def handle_error(self, e):
log.err(e)
but keep getting the following error :
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQ L
syntax; check the manual that corresponds to your MySQL server version for
the right syntax to use near ')' at line 1")
can someone tell where I ignored ) ?
No comments:
Post a Comment