Tag Archives: VLDB

Calling a Stored Procedure from MicroStrategy

I alwasy wondered how one can do it. This is something that I had seen during my employment but as not involved, was not able to recall it. finally found how to do it. MicroStrategy kb search is very pathetic.

How to use it: Open VLDB Properties of the report and changed setting Pre/Post Statements based on your requirement.

Take an example: {call GenerateDate([Age Interval])}

Calling a stored precedure from MictoStrategy Report

Calling a stored precedure from MictoStrategy Report

{} curly brackets are required as per MicroStrategy.
MicroStrategy recommends using CALL statement instead of EXEC to execute/call a stored procedure.
[Age Interval] is a MicroStrategy numeric value prompt that can be passed as parameter to the stored procedure. This is optional.

Other things to do but not for all ODBC Drivers.

MicroStrategy ODBC Driver must be configured to accept results from stored procedures. As per tech-note I found only Oracle needs to do following.

UNIX: The following line must be added manually to the Data Source Name (DSN) definition in the ODBC.INI file
ProcedureRetResults=1
Windows: Open the DSN and see if there is some setting for Procedure Result. Select that.

This can be used to pass parameter to a stored procedure from MicroStrategy too. In cases where multiple values need to be passed from the same prompt, an element list prompt should be used.

Spool space error

Okay, so this is an old one, but I still find it useful.

If you can’t run a report because of a spool space error, and you can’t convince the DBA to give you a couple of gigabytes more, then you might want to go to the Report Editor, Data ->VLDB Properties -> Tables -> Intermediate Table Type and select True temporary table.

What this does is modifying the SQL so that instead of having a huge chunk of code (that would use up a lot of memory) it breaks the code into CREATE – INSERT bits that are far easier to handle. It also makes the SQL more readable by humans (this includes programmers).

By the way, this setting also comes to rescue when you get the “Database is terrified by the script and it can’t even begin to analyze it” error. I don’t have the specific error message at hand, but I know for sure that Teradata does this when the SQL code is all in one pass and is so large that it can be seen from the Moon.