In TurboIMAGE, a class can be given access to either an entire data set or
a subset of data items from a data set.
In SQL, a USER or GROUP can be given access to either an entire table or a
subset of columns or rows from the table. To give access to a subset, the DBA
can create a view. Think of a view as a filter that sits on top of
the table. The CREATE VIEW statement is used to create a view
on a table (or even on a another view).
isql => CREATE PUBLIC TABLE Parts.Vendors
> (PartNumber char(16),
> VendorNumber INTEGER,
> VendorCode INTEGER)
> IN partsfileset;
isql => CREATE VIEW Parts.SpecialVendors
> as SELECT PartNumber,VendorNumber FROM Parts.Vendors
> where VendorCode = 5
> IN partsfileset;
...
isql => select * from Parts.Vendors; /* THIS IS THE TABLE */
----------------+------------+-----------
PARTNUMBER |VENDORNUMBER|VENDORCODE
----------------+------------+-----------
1123-P-01 | 9001| 5
1133-P-01 | 9002| 4
1143-P-01 | 9003| 1
1153-P-01 | 9004| 5
1223-MU-01 | 9025| 5
1233-MU-01 | 9006| 4
1243-MU-01 | 9018| 1
isql => select * from Parts.SpecialVendors;/* THIS IS THE VIEW */
----------------+------------
PARTNUMBER |VENDORNUMBER
----------------+------------
1123-P-01 | 9001
1153-P-01 | 9004
1223-MU-01 | 9025