views:

1452

answers:

1

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?

A: 

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

simon622
Ok, but most views consist of multiple tables which are joined together... Does it automatically check if there is a unique combination of indices?
Ropstah