Try OpenEdge Now
skip to main content
Programming Interfaces
Data Management : ABL API for Multi-tenant and Table Partition Management : Filtering and sorting : Filter expressions
 
Filter expressions
The API expects the filter to be expressed as a character expression, passed directly to the collection Get*( ) methods, or assigned to properties of IRequestInfo instances (see Filtering on a child collection using the RequestInfo class).
The query expression syntax is similar to any ABL expression with the following differences:
*The expression references properties of the class.
*The values in the property expression must be quoted irrespective of data type. This is similar to the requirement for dynamic queries to handle numeric and date formats according to session settings, but in this case it is not optional, and is required for all data types, including LOGICAL.
*Child collections that represent many to many relations support a qualifier to query the object at the other end of the relation.
The following code shows the filter used to retrieve tenants that have not yet been allocated in order to allocate them:
define variable tenantSet as ITenantSet no-undo.
define variable iterator as IIterator no-undo.

tenantSet = service:GetTenants("IsAllocated = 'false'").
iterator = tenantSet:Iterator().
do while iterator:HasNext():
cast(iterator:Next(),ITenant):Allocate().
end.
The following code shows the filter used to retrieve Type 2 areas. This is an example of a query that cannot be directly expressed against the area table in the database:
define variable areaSet as IAreaSet no-undo.
areaSet = service:GetAreas("IsType2 = 'true'").