The entity SQLQuery is exposed in the Service Layer, providing you with:
- A more dynamic way to execute a query in a secure and controllable way.
- A simpler process for deploying a query.
- An easier and more familiar way to develop query resources using a limited subset of SQL. This way you don’t need to learn a new query language, such as LINQ, HQL or DBQI/DBD.
By using SQLQueries, you can create, retrieve, update, and delete query resources. You can also define parameterized queries, which allow you to work with dynamic inputs.
OData 4.0 - Metadata
1234567891011121314<EntityType Name="SQLQuery">
<Key>
<PropertyRef Name="SqlCode"/>
</Key>
<Property Name="SqlCode" Nullable="false" Type="Edm.String"/>
<Property Name="SqlName" Type="Edm.String"/>
<Property Name="SqlText" Type="Edm.String"/>
<Property Name="ParamList" Type="Edm.String"/>
<Property Name="CreateDate" Type="Edm.DateTimeOffset"/>
<Property Name="UpdateDate" Type="Edm.DateTimeOffset"/>
</EntityType>
<EntitySet EntityType="SAPB1.SQLQuery" Name="SQLQueries"/>
The List function is a bounded function to run the query represented by a specific SQLQuery. Once an SQLQueryentity is created, the List function can be invoked in the following way with the verb GET or POST:
OData 4.0 - Metadata
1234567891011121314<Function IsBound="true" Name="List">
<Parameter Name="SQLQueryParams" Type="SAPB1.SQLQuery"/>
<Parameter Name="ParamList" Type="Edm.String"/>
<ReturnType Type="SAPB1.SQLQueryResult"/>
</Function>
<ComplexType Name="SQLQueryParams">
<Property Name="SqlCode" Type="Edm.String"/>
</ComplexType>
<ComplexType Name="SQLQueryResult" OpenType="true">
<Property Name="SqlText" Type="Edm.String"/>
</ComplexType>