Find Invalid views
The below SQL can be used to identify invalid views .. (extract from the Unix script ..)
select 'select 1 from ${DATABASENAME}.'||TRIM(TableName)||' where 1 = 2; //
.IF ERRORCODE <> 0 THEN INSERT INTO temp_db.invalid_views values(''${DATABASENAME}'','''||TRIM(TableName)||''');' (TITLE '') from dbc.tables
where databasename = '${DATABASENAME}';
select 'select 1 from ${DATABASENAME}.'||TRIM(TableName)||' where 1 = 2; //
.IF ERRORCODE <> 0 THEN INSERT INTO temp_db.invalid_views values(''${DATABASENAME}'','''||TRIM(TableName)||''');' (TITLE '') from dbc.tables
where databasename = '${DATABASENAME}';