Updating data in a view oracle

Posted by / 21-Nov-2017 00:33

Updating data in a view oracle

Another limitation of views that you may be familiar with is that a view cannot be indexed. In SQL Server 2000, you can indeed create indexed views, as shown later in this chapter.

Views still, however, don't allow you to perform any of the other major SQL actions besides selecting—views can't contain syntax when defining a view.

The primary use of views is to present data to users of an application.

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 = 'Microsoft'; 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 = 'Apple'; A VIEW in Oracle is created by joining one or more tables.

Views have never in the past been able to contain parameters; however, as shown later in the chapter, user-defined functions can now be used like views, effectively allowing you to create parameterized views that return different results depending on the parameter values that get passed in each time the function is run.

Unlike stored procedures (which also support parameters), these parameterized functions can be updateable, as you'll see later in this chapter.

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

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

updating data in a view oracle-42updating data in a view oracle-74updating data in a view oracle-88

If the view exists it will be replaced with the new definition or a new view will be created.

One thought on “updating data in a view oracle”