INSTEAD OF Triggers

In many installations, views are used as a way of limiting access to base tables. With a view, a DBA can restrict both the columns and sets of rows that a user can access. However, the use of views causes some difficulties when data modification commands need to be applied to rows in the base table. For instance, a user might have created a customer reference table with the following definition:

						CREATE TABLE CUSTOMERS
						  (
						  CUSTNO      INT           NOT NULL,
						  CUSTNAME    VARCHAR(20)   NOT NULL,
						  PHONE       CHAR(12)      NOT NULL,
						  CREDIT_CARD VARCHAR(20)   FOR BIT DATA NOT NULL,
						  YTD_SALES   DECIMAL(15,2) NOT NULL
						  )
					

This table needs to be made available to a variety of people in the company, including salespeople, the order desk, customer service, and accounts ...

Get DB2® Version 8: The Official Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.