RoiMinuit
RoiMinuit

Reputation: 414

JSON Blob into SQL Server

I have data from a web API that I want to store in a SQL database. Each record in the web API looks like this:

>>> inci[1]
>>> Out[47]: 
{'@odata.etag': 'W/"97914784"',
 x

Upvotes: 0

Views: 158

Answers (1)

David Browne - Microsoft
David Browne - Microsoft

Reputation: 89291

That query is invalid. Should be of the form INSERT INTO TableName(Column1, Column2) VALUES (?,?), so something like:

 cur.execute("""INSERT INTO IncidentBLOB(IncidentBLOB) VALUES (?)""", json.dumps(incident))

Upvotes: 1

Related Questions