Returns whether the specified materialized view can be defined as immediate.
sa_materialized_view_can_be_immediate( view_name , owner_name )
view_name Use this CHAR(128) parameter to specify the name of the materialized view. If view_name is NULL, an error is returned.
owner_name Use this CHAR(128) parameter to specify the owner of the materialized view. If owner_name is NULL, an error is returned.
There are restrictions on whether the specified manual view can be changed to an immediate view. Use this system procedure to determine whether the change is permitted.
The sa_materialized_view_can_be_immediate system procedure returns the following information for the specified materialized view.
Column name | Data type | Description |
---|---|---|
SQLStateVal | CHAR(6) | The SQLSTATE returned. |
ErrorMessage | LONG VARCHAR | The error message corresponding to the SQLSTATE. |
Each row in the result set corresponds to a single SQLSTATE returned for a view. So, if the materialized view definition violates more than one restriction, the results include multiple rows for the view.
You can combine the output of this system procedure with the output of the sa_materialized_view_info system procedure to get information about the status of views and whether they can be made immediate.
DBA authority, or execute permissions on DBO owned procedures.
All metadata for the specified materialized view, and all dependencies, are loaded into the server cache.
Execute the following statements to create a manual view, view10, and refresh it:
CREATE MATERIALIZED VIEW view10 AS (SELECT C.ID, C.Surname, sum(P.UnitPrice) as revenue, C.CompanyName, SO.OrderDate FROM Customers C, SalesOrders SO, SalesOrderItems SOI, Products P WHERE C.ID = SO.CustomerID AND SO.ID = SOI.ID AND P.ID = SOI.ProductID GROUP BY C.ID, C.Surname, C.CompanyName, SO.OrderDate); REFRESH MATERIALIZED VIEW view10; |
Use the following query to find the reasons why view10 cannot be changed to an immediate view:
SELECT SQLStateVal AS "SQLstate", ErrorMessage AS Description FROM sa_materialized_view_can_be_immediate( 'view10', 'DBA' ) ORDER BY SQLSTATE; |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |