开发者

how to set a update warning for update too many rows

I wanna to stop these query which will update more than 10k row at once.

just like mysql workbench, if i update a table without where cond开发者_高级运维ition, it will give me a warning and stop execute the sql.


there is no built-in function for this

before you sending the update statement,
you will need to execute the filter condition (ie . SELECT COUNT(*) FROM TBL WHERE...
in order to get the count of matched rows

from there, you can determine whether it should prompt a warning or not

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜