Creating a Query Table

A query table is a table whose data proceeds from the result of a query. In PowerDesigner, you design a query table using a view with a specific type, depending on the DBMS.

DB2

In DB2 CS7, you design a query table using a view with the summary table type. In later versions of DB2, you should use the materialized query table type.

For more information on summary tables and materialized views, see DB2 documentation.

Oracle

In Oracle, you design a query table using a view with the materialized view type. Materialized view is the new recommended name for snapshots that were used before version 8i.

For more information on materialized views and snapshots, see Oracle documentation.

You define a view as a query table by selecting the query table or materialized view type in the view property sheet.



The query creation order of DB2 summary table is of type:

create summary table VIEW_1 as
...

The query creation order of DB2 materialized query table is of type:

create table VIEW_1 as
...

The query creation order of Oracle materialized view is of type:

create materialized view VIEW_1 as
...

The query creation order of an Oracle snapshot is of type:

create snapshot VIEW_1 as
...

If you change the DBMS of a model containing query tables, these are converted into regular views.

Physical Options

Query tables support physical options. When you select a query table type in the view property sheet, the Options tab automatically is displayed to let you define physical options for view generation.