A Business Data Catalog Entity’s Method for a database needs two properties to be defined, RDBCommandType and RDBCommandText.
Based on the RDBCommandType, the RDBCommandText needs an appropriate value.
Text - SQL query
StoredProcedure - name of a stored procedure to execute
TableDirect - name of a table
<Properties>
<Property Name="RdbCommandText" Type="System.String">
SELECT ProductID, Name, ProductNumber, ListPrice FROM Product WHERE (ProductID = @ProductId) AND (Name LIKE @Name) AND (ProductNumber LIKE @ProductNumber)
</Property>
<Property Name="RdbCommandType" Type="System.Data.CommandType">Text
</Property>
</Properties>
As we know each BDC property has a name and type. The name for the Command Type property should be RDBCommandText and its type is System.String.
You can see in our above example there are several parameters added to the WHERE clause. These parameters need to be defined in the Parameters section of our BDC Entity’s Method definition. If you want to use any of these parameters as filters, then it needs to be defined in FilterDescriptors as well.
If you use BDC Meta Man to generate your Application Definition File, then this property is added automatically, based on what you use – a Stored Procedure, or Query. You can define your query text using BDC Meta Man tool’s query generator as shown below. You must edit the entity on surface, move to Methods tab, and click either the Add button or select a method and click on the Modify button.
