I am trying to update a cell which is selected based on 2 functions. One function selects rows randomly and the other selects columns randomly. Whatever value the cell may hold has to be replaced with NULL. There has to be one NULL cell in 10% of the rows.
The code is as follows:
entry=(cols,empty_rows)
cur.execute("update pkg_info set %s=NULL where pkg_id=%s",entry)
The exact error is as follows:
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''isDeliverable'=NULL where pkg_id=8' at line 1
I suspect the problem is that the column name (isDeliverable in this case) is enclosed within quotation marks. Other possible problems and solutions are welcome.
Thanks all in advance!
The code is as follows:
entry=(cols,empty_rows)
cur.execute("update pkg_info set %s=NULL where pkg_id=%s",entry)
The exact error is as follows:
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''isDeliverable'=NULL where pkg_id=8' at line 1
I suspect the problem is that the column name (isDeliverable in this case) is enclosed within quotation marks. Other possible problems and solutions are welcome.
Thanks all in advance!