DB2 graphic  QMF Version 8

Creating a view of a table

You can create a view that includes some or all of the columns in one or more tables. You can use a view just as you would a table. When you update the tables or tables you used to create the view, the view is also updated. When you update the view, the tables are updated.

You might find it useful to create a view of a table when you want a portion of a table to remain hidden. Creating a view from portions of several tables can simplify query development because you only have to specify that view instead of selecting several tables and joining them.

The following example shows how to create a view of the CALENDAR table, called MYCAL, with the REASON column omitted.

CREATE VIEW MYCAL
  (CALDATE, TIME, LOCATION)
AS SELECT CALDATE, TIME, LOCATION
  FROM CALENDAR


Go to the previous page Go to the next page

Downloads | Library | Support | Support Policy | Terms of use | Feedback
Copyright IBM Corporation 1982,2004 Copyright IBM Corporation 1982, 2004
timestamp Last updated: March, 2004