Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Error updating a table that has a json field

danisanspbr's profile image danisanspbr posted 2 months ago in General Permalink

Hi, I have a table with a json field when i try to update any data i get this error

"0 rows updated when that should have been 1"

Explanatory video: https://www.youtube.com/watch?v=Xg4yKgqwZjU

This is because when I edit a table that has a json field, the update does not find the record for the update

Would it be possible to ignore the json fields in the update, to be able to edit tables with json?

My version of HeidiSql: 11.2 thank you!

ansgar's profile image ansgar posted 2 months ago Permalink

That's mostly caused by a missing primary or unique key. Does the table has a primary or unique key?

danisanspbr's profile image danisanspbr posted 2 months ago Permalink

Perfect! I managed to solve it by adding a PK ALTER TABLE table ADD PRIMARY KEY(id);

before i only had one index INDEX datasets_primary_id (id) USING BTREE

Thanks, and congratulations on the work

Daniel

Please login to leave a reply, or register at first.




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.