MySQL Views in Navicat - How to define 'primary key'?

我们两清 提交于 2019-12-07 05:19:28

问题


Often when I define a View in Navicat I receive the following message:

xxx does not have a primary key. Updates to this table will be done using the following pseudo statement: UPDATE xxx SET ModifiedFieldsAndValues WHERE AllFieldsAndOldValues LIMIT 1

Obviously I only use my Views for viewing data, not updating. But this did make me curious:

Is there a way to define a "primary key" or "unique index" on a View?


回答1:


its implied that the view uses the indices and primary keys of its base table. You can change the semantics of how insert and updates occur when using them via views by playing with the CASCADING CHECK options

See Updatable and Insertable Views



来源:https://stackoverflow.com/questions/884167/mysql-views-in-navicat-how-to-define-primary-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!