How to find Invalid views on SAP Sybase IQ database


This section shows list of invalid view in IQ (SQL: “select U.user_name , T.table_name as object_name from sysobject O, systab T, sysuser U where T.object_id=O.object_id and U.user_id=T.creator and O.status=2 ”).


select U.user_name + '.' + T.table_name from sysobject O, systab T, sysuser U where T.object_id = O.object_id and U.user_id = T.creator and O.status = 2 /* Invalid */ and O.object_type = 2 /* views */
 SYSOBJECT

status
TINYINT
The status of the object. Values include:
  • 1 (valid) - The object is available for use by the database server. This status is synonymous with ENABLED. That is, if you ENABLE an object, the status changes to VALID.
  • 2 (invalid) - An attempt to recompile the object after an internal operation has failed, for example, after a schema-altering modification to an object on which it depends. The database server continues to try to recompile the object whenever it is referenced in a statement.
  • 4 (disabled) - The object has been explicitly disabled by the user, for example using an ALTER TABLE...DISABLE VIEW DEPENDENCIES statement.
object_type
TINYINT
Type of object. Values include:
  • 1 - Table
  • 2 - View
  • 3 - Materialized view
  • 4 - Column
  • 5 - Index
  • 6 - Procedure
  • 7 - Trigger
  • 8 - Event
  • 9 - User
  • 10 - Publication
  • 11 - Remote type
  • 12 - Login mapping
  • 13 - JAR
  • 14 - Java class
  • 16 - Service
  • 17 - Text configuration
  • 18 - Dbspace

Comments

Popular posts from this blog