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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With