Driving Behavioral Change for Information Management through Data-Driven Gree...
Microstrategy Intermediate Tables
1. It's not possible in MicroStrategy, but even if it was, how would you then join the data between your Teradata Warehouse and Oracle temp tables? MicroStrategy's Multisource option works by inserting the data into a temp table on the warehouse side, so you'd be right back where you started!A better solution if you don't like temp tables is to change the VLDB Property for Tables -> Intermediate Table Type to Derived Table. This will do 1 query with subselects instead of temp tables. I think that method works better for Teradata anyway.<br />Permanent TablePermanent tables are normal tables and are accessible to all the users on the databases (based on DB privileges). Permanent tables do not mean that are left of the database, they are deleted at the end of the SQL, unless quot;
dropquot;
command is not included in query execution.Derived TableDerived table is a nested quot;
select..quot;
statement. Its a virtual table which is calculated from a quot;
selectquot;
statement on the fly. Processing of the derived table is done on the database server memory. As there is no table created on the DB, all the processing is done only on the database server's memory.True Temp tableTrue temp tables are standard temporary tables. Based on the database, command to create true temp table might vary. Example: In DB2 UDB, quot;
declare global temporary tablequot;
is used to create a true temp table. Also, in databases like MySQL and Netezza, true temp tables are dropped after the connection to the DB is terminated.True Temp ViewWhen using this option, quot;
Create viewquot;
command is used instead of quot;
create tablequot;
. However, there are some cases where quot;
create viewquot;
will not be used even when defined. This is the expected behavior and MSTR knowledge base should have more information on this.<br />How to modify table creation syntax using VLDB Properties for intermediate tables in MicroStrategy SQL Generation Engine 8.1.x and 9.x <br />Certain data warehouses may call for additional parameters to be specified in quot;
create tablequot;
or quot;
select... intoquot;
statements, to ensure that intermediate tables are created in the proper table space or with the correct transaction isolation or logging. Several VLDB Properties exist in the MicroStrategy SQL Generation Engine 8.x to allow database-specific phrases to be inserted into table creation statements.<br />Table Qualifier <br />Table Descriptor <br />Table Prefix <br />Table Option <br />Table Space <br />Create Post String <br />Intermediate tables may be created as quot;
Permanentquot;
or quot;
True temporaryquot;
tables, as configured in the Tables > Intermediate Table Type VLDB Property. quot;
True temporaryquot;
tables are intended as a quick way to generate standard temporary table syntax for a given database. The above VLDB Properties are ignored in most cases when quot;
True temporary tablequot;
is chosen as the Intermediate Table Type.<br /> <br />If specific table creation syntax is needed, the Intermediate Table Type should be configured as quot;
Permanent tablequot;
to enable all the above VLDB Properties. quot;
Permanent tablequot;
does not mean that the table will necessarily be permanent in the database. Unless the quot;
Drop Temp Table Methodquot;
VLDB Property is changed away from the default, MicroStrategy will drop intermediate tables at the end of report execution. Teradata volatile tables can be created using the Permanent table type by setting the Table Qualifier to quot;
volatile,quot;
for example. Volatile tables are not the same as permanent tables on the database, but we must use the Permanent table type to generate the syntax.<br /> <br />The exception is found in databases such as DB2 UDB, which use quot;
create tablequot;
for permanent tables and quot;
declare global temporary tablequot;
for true temporary tables. It is not possible to use table creation VLDB Properties to modify quot;
declare global temporary tablequot;
syntax extensively, and the table creation VLDB Properties cannot turn the permanent table type's quot;
create tablequot;
syntax into quot;
declare local temporary table.quot;
<br /> <br />The precise positions of the VLDB strings may differ on some database platforms, but they will generally conform to the following templates. Two templates are presented below, because intermediate tables may be created using explicit or implicit methods (configured in the quot;
Table Creation Typequot;
VLDB Property).<br /> <br />For these examples, the VLDB Properties were configured as follows:<br />Table Qualifier: TABLE QUALIFIER <br />Table Descriptor: TABLE DESCRIPTOR <br />Table Prefix: TABLE_PREFIX. <br />Table Option: TABLE OPTION <br />Table Space: TABLE SPACE <br />Create Post String: CREATE POST STRING <br />Explicit table creation:<br />create TABLE QUALIFIER table TABLE DESCRIPTOR TABLE_PREFIX.ZZMD00 TABLE OPTION (<br /> YEAR_ID SMALLINT,<br /> REGION_ID SMALLINT,<br /> CATEGORY_ID SMALLINT,<br /> Revenue FLOAT,<br /> WJXBFS1 FLOAT)<br />TABLE SPACE<br />CREATE POST STRING<br /> Implicit table creation:<br />NOTE: In implicit table creation, the same SQL pass creates the table and populates it with data. The MicroStrategy Engine considers this to be an quot;
insertquot;
pass rather than a quot;
createquot;
pass. Therefore, the Create Post String VLDB property is not used, and the Insert Post String property is used in its place. Insert Post String is found in the Select/Insert folder.<br />select a14.YEAR_ID YEAR_ID,<br /> a13.REGION_ID REGION_ID,<br /> a12.CATEGORY_ID CATEGORY_ID,<br /> sum(a11.TOT_DOLLAR_SALES) Revenue,<br /> sum((a11.TOT_DOLLAR_SALES - a11.TOT_COST)) WJXBFS1<br />into TABLE QUALIFIER TABLE DESCRIPTOR TABLE_PREFIX.ZZMD00TABLE OPTION<br />TABLE SPACE<br />from SUBCATEG_MNTH_CTR_SLS a11<br /> join LU_SUBCATEG a12<br /> on (a11.SUBCAT_ID = a12.SUBCAT_ID)<br /> join LU_CALL_CTR a13<br /> on (a11.CALL_CTR_ID = a13.CALL_CTR_ID)<br /> join LU_MONTH a14<br /> on (a11.MONTH_ID = a14.MONTH_ID)<br />where a13.REGION_ID in (1, 2, 3, 4, 5, 6, 7)<br />group by a14.YEAR_ID,<br /> a13.REGION_ID,<br /> a12.CATEGORY_ID<br />INSERT POST STRING<br /> <br />Note that there is no space separating the Table Prefix VLDB Property from the table name (ZZMD00). If the prefix should have a dot, the user must specify so explicitly in the property value.<br />