Change a manual view to an immediate view

When you create a materialized view its refresh type is manual. However, you can change it to immediate. To change from manual to immediate, the view must be in an uninitialized state (contain no data). If the view was just created and has not yet been refreshed, it is uninitialized. If it has data in it, you must truncate the data. The view must also have a unique index, and must conform to the restrictions required for an immediate view. See Additional restrictions for immediate views.

An immediate view can be converted to manual at any time by simply changing its refresh type.

The following procedures explain how to change a manual view to an immediate view. Before performing one of these procedures, verify the manual view has a unique index and is uninitialized. Then, optionally, check its eligibility for immediate refresh type using the sa_materialized_view_can_be_immediate system procedure. See sa_materialized_view_can_be_immediate system procedure.

 To change a manual view to an immediate view (Sybase Central)
  1. Use the SQL Anywhere 12 plug-in to connect to the database as a user with DBA authority or as the owner of the view and all of the tables it references.

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

  3. Right-click the materialized view and choose Properties.

  4. In the Refresh Type field, choose Immediate.

  5. Click OK.

 To change a manual view to an immediate view (SQL)
  1. Connect to the database as a user with DBA authority, or as owner of the view and all the tables it references.

  2. Change the refresh type to immediate by executing an ALTER MATERIALIZED VIEW ... IMMEDIATE REFRESH statement.

The following procedures explain how to change an immediate view to a manual view.

 To change an immediate view to a manual view (Sybase Central)
  1. Use the SQL Anywhere 12 plug-in to connect to the database as a user with DBA authority or as the owner of the view.

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

  3. Right-click a materialized view and choose Properties.

  4. In the Refresh Type field, choose Manual.

  5. Click OK.

 To change an immediate view to a manual view (SQL)
  1. Connect to the database as the owner of the view, or as a user with DBA authority.

  2. Change the refresh type to manual by executing an ALTER MATERIALIZED VIEW ... MANUAL REFRESH statement.

 Example
 See also