In the following codes,I want insert authors by locating link.
self.cur.execute("""
UPDATE articles
SET authors = %s
WHERE link = %s returning id;
""" % (authors, link))
ret_id = self.cur.fetchone()
And two problems are encountered:
Some names are not regular like this:
LINE 1: UPDATE articles SET authors = Francesco D'Angelo, Roberto T...When author names are no problem:
"""UPDATE articles SET authors = %s WHERE link = %s returning id;""" % (authors, link)) psycopg2.ProgrammingError: syntax error at or near ":" LINE 1: ...DATE articles SET authors = test WHERE link = http://www.wor...