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

KB204252: Null value returns when executing procedure to print out result set of "LIST ALL PROPERTIES FOR SUBSCRIPTION …" in MicroStrategy Analytics Command Manager 9.4.1


Community Admin

• Strategy


Null value returns when executing procedure to print out result set of "LIST ALL PROPERTIES FOR SUBSCRIPTION …" in MicroStrategy Analytics Command Manager 9.4.1

SYMPTOM:
A user has created a procedure in Command Manager to print out the result set of "LIST ALL PROPERTIES FOR SUBSCRIPTION GUID "+guid+" FOR PROJECT 'xxxx';". Null values are returned after the execution though the script has passed compilation, as shown below.

ka04W000000OebpQAC_0EM440000002CE2.jpeg

 
STEPS TO REPRODUCE:
The following steps are performed in Tutorial project.

  1. Create a new procedure in Command Manager with the scripts below:
    
    ResultSet slist=(ResultSet) executeCapture("LIST ALL SUBSCRIPTIONS FOR OWNER               
    'Administrator' FOR PROJECT 'Strategy Tutorial';");
    slist.moveFirst();
    while(!slist.isEof())
    
          {          
          String guid=slist.getFieldValueString(DisplayPropertyEnum.GUID);
          ResultSet list=executeCapture("LIST ALL PROPERTIES FOR SUBSCRIPTION GUID "+guid+" 
          FOR   PROJECT 'Strategy Tutorial';");
          printOut("LIST ALL PROPERTIES FOR SUBSCRIPTION GUID "+guid+" FOR PROJECT  
          'Strategy Tutorial';");
          if(list.getRowCount()==0){System.exit(0);}
          list.moveFirst();
          String username=list.getFieldValueString(DisplayPropertyEnum.OWNER);
          String creationtime=list.getFieldValueString(DisplayPropertyEnum.CREATION_TIME);
          String name=list.getFieldValueString(DisplayPropertyEnum.NAME);
          printOut(name+"         "+username+"         "+creationtime);
          slist.moveNext();
          }
    
    

  2. Execute script. Null value is received.

 
CAUSE:
The data structure for subscription result set has been changed whereas the usage guidance has not been updated in Command Manager documentation. Therefore the syntax used this case is incorrect. 
 
ACTION: 
An enhancement request has been logged to update the data structure for subscription result set.
 
Following two lines should be added to the script.


ResultSet oResultSetSubProps = (ResultSet)list.getResultCell(SUBSCRIPTION_RESULT_SET).getValue(); 
oResultSetSubProps.moveFirst();

 
Run below script in a procedure, the result can be parsed successfully. Highlighted scripts are modified parts comparing to the original.

ResultSet slist=(ResultSet) executeCapture("LIST ALL SUBSCRIPTIONS FOR OWNER 'Administrator' FOR PROJECT 'Strategy Tutorial';"); 
slist.moveFirst(); 
while(!slist.isEof()) 

      { 
      String guid=slist.getFieldValueString(DisplayPropertyEnum.GUID); 
      ResultSet list=executeCapture("LIST ALL PROPERTIES FOR SUBSCRIPTION GUID "+guid+" FOR PROJECT 'Strategy Tutorial';"); 
      printOut("LIST ALL PROPERTIES FOR SUBSCRIPTION GUID "+guid+" FOR PROJECT 'Strategy Tutorial';"); 
      if(list.getRowCount()==0){System.exit(0);} 
      list.moveFirst(); 
      ResultSet oResultSetSubProps = (ResultSet)list.getResultCell(SUBSCRIPTION_RESULT_SET).getValue(); 
      oResultSetSubProps.moveFirst(); 
      String username=oResultSetSubProps.getFieldValueString(DisplayPropertyEnum.OWNER); 
      String creationtime=oResultSetSubProps.getFieldValueString(DisplayPropertyEnum.CREATION_TIME); 
      String name=oResultSetSubProps.getFieldValueString(DisplayPropertyEnum.NAME); 
      printOut(name+"         "+username+"         "+creationtime); 
      slist.moveNext(); 
      }


 


Comment

0 comments

Details

Knowledge Article

Published:

June 8, 2017

Last Updated:

June 8, 2017