Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - SQL Usage » Tables, views, and indexes » Views » Regular views


Disabling or enabling a regular view (Sybase Central)

You can control whether a regular view is available for use by the database server by enabling or disabling it.


You must be the owner, or have one of the following privileges:

  • ALTER ANY VIEW system privilege
  • ALTER ANY OBJECT system privilege

To enable a regular view, you must also have the following privileges SELECT privilege on the underlying table(s), or the SELECT ANY TABLE system privilege.

Before you enable a regular view, you must re-enable any disabled views that it references.

  1. In Sybase Central, use the SQL Anywhere 16 plug-in to connect to the database.

  2. In the left pane, double-click Views.

  3. To disable a regular view, right-click the view and click Disable.

  4. To enable a regular view, right-click the view and click Recompile And Enable.


When you disable a regular view, the database server keeps the definition of the view in the database; however, the view is not available for use in satisfying a query.

If a query explicitly references a disabled view, the query fails and an error is returned.


Once you re-enable a view, you must re-enable all other views that were dependent on the view before it was disabled. You can determine the list of dependent views before disabling a view by using the sa_dependent_views system procedure.

When you enable a regular view, the database server recompiles it using the definition stored for the view in the database. If the compilation is successful, the view status changes to VALID. An unsuccessful recompile could indicate that the schema has changed in one or more of the referenced objects. If so, you must change either the view definition or the referenced objects until they are consistent with each other, and then enable the view.

Once a view is disabled, it must be explicitly re-enabled so that the database server can use it.

 See also