for i in onlycolumns: if i not in pat and i not in ref: new=lister.index(i) value1 = lister[new+1] query='ALTER TABLE test add %s varchar(30)' %i cursor.execute(que
Solution 1:
The problema is with the SET: Use
SET %s = %s.
You miss the the s near one %.
Post a Comment for "Python Mysql Dynamic Add Column And Update Values In The New Columns"