Skip to content

List Invalid Views in Sybase IQ

February 11, 2013

In Sybase IQ a view can become invalid is the schema of the depending object is modified.

The following code will list all the views in invalid status.

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 */

Views that depend on the base tables, can still be compiled by the Sybase IQ engine and returns rows even it the base tables has been modified, as long as the view definition is still valid. Views that depend on other views, will give error if the depending view is in invalid status, even it the depending view can compile and return rows.

It is a good practice to monitor the status of the views and enable or recompile any active view or delete any unnecessary view.


From → SAP IQ

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: