Found nothing on stackoverflow. HELP!!
Posted by: vilas kafre
Date: July 16, 2020 12:56AM

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!

Options: ReplyQuote


Subject
Written By
Posted
Found nothing on stackoverflow. HELP!!
July 16, 2020 12:56AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.