"Robert Stearns" <rs**********@charter.net> wrote in message
news:10************@corp.supernews.com...
Can I construct a restricted view and grant select access on it to a
user without granting select access to the underlying tables and views?
This seems to be an easy way to restrict a user to just 'his part' of
the database.
Yes, you can give users access to views without giving them access to the
underlying tables. That is one of the main benefits of views in DB2.
Note that views may or may not be read-only, depending on how they are
defined. For example, if a view is defined on a join of two or more tables,
it is always automatically read-only. The exact rules for what makes a view
read-only are stated in the SQL Reference. If they are not read-only, you
may or may not want to take precautions to prevent updates via those views.
Also, views may be based on other views, to as many levels as you like so
that it is perfectly possible to have a view of a view of a view of a view.
Be careful though: if your view is based on another view or table, if that
object is dropped, your view also disappears, automatically and without
warning.
Rhino