Accessing heterogeneous data through federated views

A federated view is a view in the federated database whose base tables are located at remote data sources. The federated view references base tables with nicknames, instead of the data source table names.

Before you begin

You must have one of the following authorizations to issue the CREATE VIEW statement:
  • SYSADM or DBADM
  • For each nickname in any fullselect, both:
    • CONTROL or SELECT privilege on the underlying table or view
    • One of the following authorities or privileges:
      • IMPLICIT_SCHEMA authority on the federated database, if the implicit or explicit schema name of the view does not exist
      • CREATEIN privilege on the schema, if the schema name of the view refers to an existing schema

Privileges for the underlying objects are not considered when defining a view on a federated database nickname.

About this task

When you query from a federated view, data is retrieved from the remote data source. The action of creating a federated database view of data source data is sometimes called creating a view on a nickname. This is because you reference the nicknames instead of the data sources when you create the view.

These views offer a high degree of data independence for a globally integrated database, just as views defined on multiple local tables do for centralized relational database managers.

Restrictions:
  • Federated views with UNION ALL statements are read-only views.
  • Federated views that include more than one nickname in the FROM clause are read-only views.
  • Federated views that include only one nickname in the FROM clause might be read-only views.
    • If the nickname in the FROM clause is to a non-relational data source, the federated view is read-only.
    • If you include other nicknames as predicates or as subqueries when you create the view, the federated view can be updated.

Procedure

Issue the CREATE VIEW statement to create a federated view.

Authorization requirements of the data source for the table or view referenced by the nickname are applied when the query is processed. The authorization ID of the statement can be mapped to a different remote authorization ID by a user mapping.