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


Altering a regular view

You edit a regular view by editing its definition in the database. For example, if you want the view to contain data from an additional table, you would update the view definition to join the table data with the existing data sources in the view definition.


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

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

Context and remarks

You may need to alter a view if the view definition is out of date (won't compile because of a schema change in the underlying data), needs columns added or removed, or requires changes related to its settings.

You cannot rename an existing view. Instead, you must create a new view with the new name, copy the previous definition to it, and then drop the old view.

  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. Select the view.

  4. In the right pane, click the SQL tab and edit the view's definition.


    To edit multiple views, you can open separate windows for each view rather than editing each view on the SQL tab in the right pane. You can open a separate window by selecting a view and then clicking File » Edit In New Window.

  5. Click File » Save.


The definition of the view is updated in the database.


Query the view to examine the results and ensure the correct data is returned.

If you alter a regular view and there are other views that are dependent on the view, there may be additional steps to take after the alteration is complete. For example, after you alter a view, the database server automatically recompiles it, enabling it for use by the database server. If there are dependent regular views, the database server disables and re-enables them as well. If they cannot be enabled, they are given the status INVALID and you must either make the definition of the regular view consistent with the definitions of the dependent regular views, or vice versa. To determine whether a regular view has dependent views, use the sa_dependent_views system procedure.

 See also