I am trying to insert many columns into a table row using psycopg2 with Python 2.7. Is there a way for me to shorten the INSERT syntax? I currently have to type out the placeholder (%s) over and over again like VALUES(%s,%s,%s,...%s)
Edit: Currently I have
tableCursor.execute('INSERT INTO "table" ("x1","x2","x3","x4")' +
'VALUES (%s,%s,%s,%s)', (val1,val2,val3,val4))
I want to use more than placeholders but it's kinda repetitive to keep typing %s.