I want to provide a Python list
sql_foramt= ['HP7CXNGSUFEPZCO4GS5RQPY6XY', '9475EFWZCNARPEJEZEMXDFHIBI',
'6ECWZUQGEJCR5EZXDH9URCN53M', 'XZ9P6KTDGREM5KIXUO9IHCTKAQ']
as a input to above SQL query in Python.
cur.execute("""CREATE TEMP TABLE ##Validation_Marc (
Codes varchar(250) );
INSERT INTO ##Validation_Marc
VALUES
{}.format(','.join(list_name);
I'm trying to run the SQL query via Python using psycopg2 library. I have tried the above method, but every time I try I get the error:
Traceback (most recent call last): File "", line 48, in psycopg2.errors.SyntaxError: syntax error at or near "{" LINE 8: {}.format(','.join(list_name);
I'm unable to move forward , plese help