Updating views in sql

If you recreate the table (the table that you had dropped), the SQL VIEW will again be fine.

A view is nothing more than a SQL statement that is stored in the database with an associated name.

For information about generated columns, see Section 13.1.20.9, “CREATE TABLE and Generated Columns”.

It is sometimes possible for a multiple-table view to be updatable, assuming that it can be processed with the are illegal and are rejected.

Yes, in Oracle, the SQL VIEW continues to exist even after one of the tables (that the SQL VIEW is based on) is dropped from the database.

However, if you try to query the SQL VIEW after the table has been dropped, you will receive a message indicating that the SQL VIEW has errors.

Note that it is sometimes possible to create updatable views based on multiple tables using an inner join. There are also certain other constructs that make a view nonupdatable.To be more specific, a view is not updatable if it contains any of the following: .Although such a view is not insertable, it can be updatable if you update only columns that are not expressions.CREATE VIEW sup_orders AS SELECT suppliers.supplier_id, orders.quantity, orders.price FROM suppliers INNER JOIN orders ON suppliers.supplier_id = orders.supplier_id WHERE suppliers.supplier_name = 'IBM'; CREATE or REPLACE VIEW sup_orders AS SELECT suppliers.supplier_id, orders.quantity, orders.price FROM suppliers INNER JOIN orders ON suppliers.supplier_id = orders.supplier_id WHERE suppliers.supplier_name = 'Microsoft'; A VIEW in SQL is created by joining one or more tables.

Leave a Reply