Rules for materialized query table

If one or more source tables in the materialized query table definition contain a security label column, certain rules apply to creating a materialized query table.

About this task

Begin general-use programming interface information.
  • If only one source table contains a security label column, the following conditions apply:
    • You must define the security label column in the materialized query table definition with the AS SECURITY LABEL clause.
    • The materialized query table inherits the security label column from the source table.
    • The MAINTAINED BY USER option is allowed.
  • If only one source table contains a security label column and the materialized query table is defined with the DEFINITION ONLY clause, the materialized query table inherits the values in the security label column from the source table. However, the inherited column is not a security label column.
  • If more than one source table contains a security label column, Db2 returns an error code and the materialized query table is not created. End general-use programming interface information.