none
when doing parameterized MDX query via ODBO(msolap.dll), if we define more than 3 parameters in our MDX statement, the function ICommand::Execute will return E_FAIL RRS feed

  • Question

  • Hi, I a, sitting with one problem that I'm unable to solve. when doing parameterized MDX query via ODBO(msolap.dll), if we define more than 3 parameters in our MDX statement, the function ICommand::Execute will return E_FAIL(A provider-specific error occurred).  But it works ok with 1 or 2 or 3 parameters. I have tried the latest version of MSOLAP, it still has the problem if defien more than 3 parameters.   Thanks.
    Friday, May 29, 2020 2:20 AM

All replies

  • As I mentioned in the other thread where you asked this question, I do not believe there is any hard limit on the number of parameters and I've worked with queries with 10+ parameters with no issue. The most likely explanation is that you have some syntax error in your MDX.

    http://darren.gosbell.com - please mark correct answers

    Friday, May 29, 2020 2:49 AM
    Moderator
  • I agree with you about there is any hard limit on the number of parameters.

    It works if define 1 or 2 or 3 parameters. The same code, I can make sure the MDX with 4 parameters no syntax error

    Another two points.

    1.Did you do the queries with 10+ parameters by ODBO(msolap.dll) by calling ICommand::Eexcute? I have tried the latest version ODBO driver. Still not resolve it.

    2.I construct  XMLA command with the same statement (parameterized MDX with 4 or more parameters) and execute it directly in SQL Server management Studio, it also works ok. The XMLA command looks like this:

    <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
          <Body>
            <Execute xmlns="urn:schemas-microsoft-com:xml-analysis">
              <Command>
                <Statement>
                  Your code in here
                </Statement>
              </Command>
              <Properties>
                <PropertyList xmlns="urn:schemas-microsoft-com:xml-analysis">
                  <DataSourceInfo>Provider=MSOLAP;Data Source=local;</DataSourceInfo>
                  <Catalog>CubeName</Catalog>
                  <Format>Tabular</Format>
                  <Content>Data</Content>
                  <Timeout>0</Timeout>
                </PropertyList>
              </Properties>
              <Parameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:schemas-microsoft-com:xml-analysis">
                <Parameter>
                  <Name>ParameterName</Name>
                  <Value xsi:type="xsd:string">ParameterValue</Value>
                </Parameter>
              </Parameters>
            </Execute>
          </Body>
        </Envelope>

    Now I doubt whether the ODBO driver does not support parameterized sql well. Thanks again.

    Friday, May 29, 2020 5:26 AM
  • I wonder why it is so strict 4 parameters? ...

    MSDN Community Support Please remember to click Mark as Answer; the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, June 5, 2020 8:20 AM