Typeerror: Not All Arguments Converted During String Formatting In Psycopg2
When I run the below code with psycopg2: cur.execute( '''INSERT INTO logmsg (msg_type, file, msg) VALUES %s;''', ['Error', str(file), str(sys.exc_info()[0])]) I get the fo
Solution 1:
VALUES
needs a list of values enclosed in brackets:
cur.execute(
"""INSERT INTO logmsg (msg_type, file, msg) VALUES (%s, %s, %s);""",
["Error", str(file), str(sys.exc_info()[0])])
Do not forget to commit the transaction.
Post a Comment for "Typeerror: Not All Arguments Converted During String Formatting In Psycopg2"