Restrictions on Views

Restrictions for using views.

  • You can create a view only in the current database.

  • The number of columns referenced by a view cannot exceed 1024.

  • You cannot create a view on a temporary table.

  • You cannot create a trigger or build an index on a view.

  • You cannot use readtext or writetext on text, unitext, or image columns in views.

  • You cannot include order by, compute clauses, or the keyword into in the select statements that define views.

  • You cannot update, insert, or delete from a view with select statements that include the union operator.

  • If you create a view using a local or a global variable, the SAP ASE server issues error message 7351: “Local or global variables not allowed in view definition.”

  • You can combine create view statements with other SQL statements in a single batch.

    Warning!   When a create view command occurs within an if...else block or a while loop, the SAP ASE server creates the schema for the view before determining whether the condition is true. This may lead to errors if the view already exists. To avoid this, verify that a view with the same name does not already exist in the database or use an execute statement, as follows:
    if not exists
        (select * from sysobjects where name="mytable")
    execute ("create table mytable (x int)")