Im having problem with single value inserts. Using pyodbc
LL= []
....
sqla = 'INSERT INTO d.table VALUES (?,?,?,?,?,?,?)'
csr.executemany(sqla, LL)
Works开发者_运维知识库, if LL is single column of data as a list...does not work.
LL= []
....
sqla = 'INSERT INTO d.table VALUES (?)'
csr.execute(sqla, LL)
How do I fix?
Then
LL= []
....
sqla = 'INSERT INTO d.table VALUES (?)'
csr.execute(sqla, LL)
If LL is Id only, The database table has cols of ID, AAA,BBB, CCC, How do I insert....
LL= [['TDW'], ['TD0'], ['TD0'], ['TDW'], ['TD10'] ]
sqla = 'INSERT INTO d.table (column_name) VALUES (?)'
This is right syntax of INSERT QUERY.
精彩评论