views:

111

answers:

0

We are using SharePoint BCS to connect to our DB2 Database, we have our method configured as the following

<Property Name="RdbCommandText" Type="System.String">select "EMPNO","FIRSTNME","MIDINIT","LASTNAME" from ADMINISTRATOR."EMPLOYEE" order by "FIRSTNME" fetch first ? rows only</Property>

we also have a limit Filter which provides the value for the ? parameter

 <FilterDescriptors>
            <FilterDescriptor Type="Limit" FilterField="FIRSTNME" Name="MyLimitFilter" />
          </FilterDescriptors>

...

  <Parameter Name="?limitFilter" Direction="In">
                  <TypeDescriptor Name="limitFilter" TypeName="System.Int64" AssociatedFilter="MyLimitFilter">
                    <DefaultValues>
                      <DefaultValue MethodInstanceName="GetAllADMINISTRATOR_EMPLOYEEEntitys" Type="System.Int64">10</DefaultValue>
                    </DefaultValues>
                  </TypeDescriptor>
                </Parameter>

The issue we have is that when SharePoint tries to call this method we get the following error message recorded in the SharePoint logs:

"The query against the database for LobSystem 'SharePointProject1', LobSystemInstance 'SharePointProject1Instance', MethodInstance 'GetAllADMINISTRATOR_EMPLOYEEEntitys', caused an error : ERROR [42601] [IBM][CLI Driver][DB2/NT64] SQL0104N An unexpected token "?" was found following "IRSTNME" fetch first". Expected tokens may include: "". SQLSTATE=42601"

If we hard code a value in then it works fine