Online Documentation for SQL Manager for DB2
MQ Tables
A Materialized query table (MQ table, or MQT) is a table based on a query that is used for the definition of the table and that determines the data included in the table.
To create a new materialized query table:
- select the Database | New Object... main menu item;
- select MQ Table in the Create New Object dialog;
- edit materialized query table properties using the appropriate tabs of MQ Table Editor.
Hint: To create a new materialized query table, you can also right-click the MQ Tables node of the DB Explorer tree and select the New MQ Table... context menu item.
To create a new materialized query table with the same properties as one of existing materialized query tables has:
- select the Database | Duplicate Object... main menu item;
- follow the instructions of Duplicate Object Wizard.
Alternatively, you can right-click a materialized query table in the DB Explorer tree and select the Duplicate MQ Table <mq_table_name>... context menu item.
Duplicate Object Wizard allows you to select the database to create a new materialized query table in, and to edit the result SQL statement for creating the materialized query table.
To edit an existing materialized query table:
- select the materialized query table for editing in the DB Explorer tree (type the first letters of the materialized query table name for quick search);
- right-click the object and select the Edit MQ Table <mq_table_name>... context menu item, or simply double-click the materialized query table;
- edit materialized query table definition using the appropriate tabs of MQ Table Editor.
To drop a materialized query table:
- select the materialized query table to drop in the DB Explorer tree;
- right-click the object and select the Drop MQ Table <mq_table_name>... context menu item;
- confirm dropping in the dialog window.
Note: If more convenient, you can also use the following shortcuts:
Ctrl+N to create a new MQ table;
Ctrl+O to edit the selected MQ table;
Shift+Del to drop the object from the database.