How to use %s if we want to add/update key-value pairs in the field which has JSON data type? #966
Unanswered
NikunjVadodariya
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Suppose I have a table named company and it has two columns one column is id(Auto increment) and another column is employee_details which has JSON data type. The value of the employee_details is a JSON and it has following properties.
I am using PyMySQL==0.9.3 for generating the query dynamically..I need to add/update name field of the employee_details JSON, So I used following query
In above I knew that I want to update name property of the employee_details, but what if I need to add/update dynamically?
Example
For above requirements I created below query
But it gives error like Invalid json. May you please suggest what is wrong in above? Is there any alternative way to fulfil my requirements of updating a JSON dynamically.
Beta Was this translation helpful? Give feedback.
All reactions