MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 26: Mapping MDX to SQL Statements


 

Local Temporary Views

An MDX statement results in a sequence of SQL SELECT statements. The result of each such statement is a virtual table that is used in the FROM clause of one or more subsequent statements. It is necessary to give a name to the result of a SELECT statement, which can be used for the duration of that session as a table in any subsequent SELECT statement.

The CREATE LOCAL TEMPORARY VIEW statement is used for this purpose. The syntax is as follows:

CREATE LOCAL TEMPORARY VIEW <view_name>
   AS <query_expression>

This statement creates a temporary view that is visible within the module for the duration of the session. It is assumed that these views are destroyed when the session terminates, so explicit DROP VIEW statements are not shown.