1. Update the view. In addition to single tables, update, insert, and delete can also be applied to views and subqueries, but there are various restrictions. Restrictions on the www.2cto.com view (subquery:
1. No set operators (sum, difference, and intersection); 2. No DISTINCT operators; 3. No aggregate or analysis functions; 4. No group by, order by, MODEL, connect by, or start with clause; 5. No set expression in SELECT; 6. No subquery in SELECT; 7. No with read only; 8. updatable associated view. 9. There is an instead of trigger. Www.2cto.com: The primary key or unique index of the base table is also unique in the associated view. Then, the base table is the key reserved table. Updatable join View:
1. No with read only; 2. ONLY one basic table can be updated at a time; 3. UPDATE rule: All UPDATE columns must come from the same key-reserved table, if the view has with check option, all associated fields and all fields in most referenced tables cannot be updated. 4. DELETE rule: you can update a key to keep the table rows, it can be referenced multiple times, but it cannot be updated if multiple references have with check option. If multiple keys are retained, the first table in the FROM clause is updated; 5. INSERT rules: a non-key reserved table field cannot be referenced obviously or implicitly. If a field with check option exists, it cannot be updated. 6. If there is an embedded view in the view, the embedded view should be merge to the main view. 2. INSERT multiple tables. Insert multiple tables unconditionally at the same time: insert all into t1 into t2... values (...); insert multiple tables that meet the conditions. Each record inserts all tables that meet the conditions: insert all www.2cto.com when condition1 then into t1 when condition2 then into t2... [else into tn] values (...); insert a table that meets the conditions. Each record is inserted into the first table that meets the conditions: insert all when condition1 then into t1 www.2cto.com when condition2 then into t2... [else into tn] values (...); if the condition is not met and there is no else clause, ignore this record. Author hulubo