Search code examples
viewattributesdb2metadatadb2-luw

Checking if row movement option is enabled in a view


DB2 allows to enable or disable row movement in a UNION ALL view:

CREATE OR REPLACE VIEW TEST.TWO_TABLES_V 
AS
SELECT * 
  FROM TEST.TABLE_1
UNION ALL
SELECT * 
  FROM TEST.TABLE_2
WITH ROW MOVEMENT;

The last line in the above example turns on row movement.

I need to divide views by this property, and I've tried to find the metadata attribute responsible for the property, in the following SYSCAT views:

  • VIEWS
  • TABLES
  • TABCONST
  • CHECKS

But no luck. Could anyone give directions to a catalog view and column(s) I should check?


Solution

  • I would do it like this:

    SELECT VIEWSCHEMA, VIEWNAME
    FROM SYSCAT.VIEWS
    WHERE  LOCATE('ROW MOVEMENT',TEXT) > 0