EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB18896: Pre / Post statements are not applied in the SQL of a report in MicroStrategy Developer 10.x


Stefan Zepeda

Salesforce Solutions Architect • Strategy


KB18896: Pre / Post statements are not applied in the SQL of a report in MicroStrategy Developer 10.x

SYMPTOM
A user sets customized pre / post statements in the database instance’s VLDB properties, and these statements are not applied when viewing the SQL generated by a report.
 
STEPS TO REPORDUCE
Follow the steps below to reproduce this issue in the Strategy Tutorial Project:
 

  1. In the Database Instance Manager, right-click on the database instance used by the Strategy Tutorial Project (by default, this would be ‘Tutorial Data’) and select VLDB Properties.
  2. Navigate to 'Pre/Post Statements' and 'Report Pre Statement 1.'
  3. Uncheck the ‘Use default inherited value’ checkbox and add the following text to the text field:
    INSERT INTO STATS VALUES (!u, !o, !p);
  4. NOTE: This will add the name of the user running the report, the name of the report, and the name of the project to a table called STATS.
     
  5. Save and close.
  6. Disconnect and reconnect to the project source.
  7. Create a new report (in this example, a report with attribute "Country" and metric "Revenue" is created, but any report will work).
  8. Execute the report and then open SQL View. The SQL generated includes the pre / post statement. However, if the report is cached, the Report Pre Statement will not appear in the SQL of the report.

CAUSE
The reason the Pre Report statement doesn’t work when reading from cache is that it only renders when the SQL Engine generates SQL. When reading from cache, the SQL Engine is not utilized, and therefore, the Pre statement is not generated.
 
ACTION
Disable caching for the reports for which it is desired for the pre / post statements to be executed every time they are run. This can be done in the report by going to the Data menu, selecting Report Caching, and then checking "Disabled: This report should not be cached."
 


Comment

0 comments

Details

Knowledge Article

Published:

June 9, 2017

Last Updated:

February 25, 2019