Updating an oracle view

Rated 3.89/5 based on 871 customer reviews

One good reason for you to create a unique index on non-primary key fields is to enforce the integrity of a candidate key, which otherwise might end up having (nonsense) duplicate values in different rows.Queries versus insertion/update: It might seem as if you should create an index on every column or group of columns that will ever by used in an ORDER BY clause (for example: last Name, first Name).You can’t change a computed value in a view, or any value in a view that is based on a UNION query.You may also use a view as the target of an INSERT or DELETE statement, subject to any integrity constraints that have been placed on the base tables.As a very simple example, suppose that you have a table of employee information on the scheme Employees = .Obviously, you can’t let everyone in the company look at all of this information, let alone make changes to it.A view is simply any SELECT query that has been given a name and saved in the database.

Unique and non-unique indexes: When you create an index, you may allow the indexed columns to contain duplicate values; the index will still list all of the rows with duplicates.An index, as you would expect, is a data structure that the database uses to find records within a table more quickly.Indexes are built on one or more columns of a table; each index maintains a list of values within that field that are sorted in ascending or descending order.• You could create separate views even on just the Employees table, and control access to them like this: CREATE VIEW phone_view AS SELECT emp FName, emp LName, emp Phone FROM Employees; GRANT SELECT ON phone_view TO public; CREATE VIEW job_view AS SELECT employee ID, emp FName, emp LName, job Title, manager ID FROM Employees; GRANT SELECT, UPDATE ON job_view TO managers; CREATE VIEW pay_view AS SELECT employee ID, emp FName, emp LName, pay Rate FROM Employees; GRANT SELECT, UPDATE ON pay_view TO payroll; • Only a very few trusted people would have SELECT, UPDATE, INSERT, and DELETE privileges on the entire Employees base table; everyone else would now have exactly the access that they need, but no more.• When a view is the target of an UPDATE statement, the base table value is changed.

Leave a Reply