I am trying to insert multiple rows into a postgresql table ..The SQL will look like this
insert into mytable(col1,col2) values(val1,val2),(val3,val4),(val5,val6)
Since the web2py batching just iterates and executes each sql statement, I am trying to avoid multiple db calls by using executesql
I tried to do this using the following code
placeholderlist=[[val1,val2],[val3,val4],[val5,val6] ]
db.executesql(insert into mytable(col1,col2) values(%s,%s),placeholderlist])
But it does not work..Can somebody please help..