Menu

Xmla and prepared statements with parameters

2010-08-12
2013-11-06
  • Brantley Wells

    Brantley Wells - 2010-08-12

    We are using the xmla driver to connect to SSAS 2008 and would like to use
    prepared statements with parameters. This doesn't seem possible with the
    current olap4j implementation, as noted in XmlaOlap4jPreparedStatement:

    private List<Parameter> getParameters() {
        // XMLA statements do not have parameters yet
        return Collections.emptyList();
    }
    

    However, Microsoft now seems to support parameters within xmla statements:

    http://msdn.microsoft.com/en-
    us/library/ms145518.aspx

    I wanted to see if this is something you guys plan on adding. Olap4j seems
    like a good fit if we could just leverage prepared statements and parameters.
    Or maybe there is a better way to accomplish what we want?

    Here is an example of xmla with parameters:

    <Envelope xmlns="[url]http://schemas.xmlsoap.org/soap/envelope/[/url]">
      <Body>
        <Execute xmlns="urn:schemas-microsoft-com:xml-analysis">
          <Command>
            <Statement>
              SELECT
              [Measures].[Internet Sales Amount] on 0,
              TOPCOUNT( [Customer].[State-Province].CHILDREN,
              @Count,[Internet Sales Amount]) ON 1
              FROM [Adventure Works]
            </Statement>
          </Command>
          <Properties>
            <PropertyList>
              <Catalog>Adventure Works</Catalog>
              <DataSourceInfo>SERVER</DataSourceInfo>
              <Format>Multidimensional</Format>
              <AxisFormat>TupleFormat</AxisFormat>
            </PropertyList>
          </Properties>
          <Parameters>
            <Parameter>
              <Name>Count</Name>
              <Value>10</Value>
            </Parameter>
          </Parameters>
        </Execute>
      </Body>
    </Envelope>
    

    Thanks,
    Brantley

     
  • Webcet

    Webcet - 2013-11-06

    We need it too..

     

Log in to post a comment.