MicroStrategy ONE

Report Pre Statement

The Report Pre Statement property is used to insert custom SQL statements at the beginning of the Report SQL. There are five settings, numbered 1-5. Each text string entered in Report Pre Statement 1 through Report Pre Statement 4 is executed separately as a single statement. To execute more than 5 statements, insert multiple statements in Report Pre Statement 5, separating each statement with a ";". The SQL Engine then breaks them into individual statements using ";" as the separator and executes the statements separately.

If you do not modify the Element Browsing Pre Statement VLDB property, the statements defined in this Report Pre Statement VLDB property are also used for element browsing requests. For example, an element browsing request occurs when a user expands an attribute to view its attribute elements. To define statements that apply only to element browsing requests, seeElement Browsing Pre Statement.

Levels at Which You Can Set This

Database instance, report, and template

Example

In the following example, the setting values are:

Report Pre Statement1=/* Report Pre Statement1 */
/* Report Pre Statement 1*/
Create table TABLENAME 
(ATTRIBUTE_COL1 VARCHAR(20), 
 FORM_COL2 CHAR(20), 
 FACT_COL3 FLOAT) 
 primary index (ATTRIBUTE_COL1, FORM_COL2) 
insert into TABLENAME 
select A1.COL1, 
 A2.COL2, 
 A3.COL3 
from TABLE1 A1, 
 TABLE2 A2, 
 TABLE3 A3 
where A1.COL1 = A2.COL1 and A2.COL4=A3.COL5 
insert into TABLENAME 
select A1.COL1, 
 A2.COL2, 
 A3.COL3 
from TABLE4 A1, 
 TABLE5 A2, 
 TABLE6 A3 
where A1.COL1 = A2.COL1 and A2.COL4=A3.COL5
create index IDX_TEMP1(STORE_ID, STORE_DESC) 
select A1.STORE_NBR, 
max(A1.STORE_DESC) 
from LOOKUP_STORE 
Where A1 A1.STORE_NBR = 1 
group by A1.STORE_NBR 
drop table TABLENAME