ravthiru ravthiru - 3 months ago 22
SQL Question

How to find dependent materialized query table

Is there a simple way to find out which materialized query tables use my table say mytable.

As i could not alter the table because it is a base table for a materialized query table.

Answer

This could be queried via the System Catalog like this:

select TABSCHEMA, TABNAME
  from syscat.tabdep
 where DTYPE = 'S'
   and BSCHEMA = 'DB2INST1' 
   and BNAME = 'EMPLOYEE'

More details about the columns can be found here.