RetrieveOQL()

The RetrieveOQL(); stitcher rule executes an OQL query that is expected to return data, against the current process. An optional record can be passed in to be added to the scope of the OQL query.

Syntax

The RetrieveOQL(); statement uses following syntax.

RetrieveOQL( oql string [, optional record] );

Arguments

The following table lists the properties of the arguments of this stitcher rule.
Table 1. Arguments of ExecuteSQL()
Argument Description Accepts constants Accepts variables Accepts eval clauses
oql string OQL command to execute. This can reference members of the optional record, if present.
Note: OQL queries must not be terminated with a semi-colon.
Yes Yes Yes
optional record If present, this will be added so that it can be dereferenced in the OQL string. No Yes No

Example

The following example shows the results of a query on the finders.returns table being assigned to a previously declared variable of datatype RecordList called devicesFound.

devicesFound = RetrieveOQL( "select m_Name from finders.returns;" );

Example

The following example shows the results of a query on the disco.agents table and displays each record retrieved using a foreach loop.

RecordList results = RetrieveOQL( "select * from disco.agents;" )

foreach (results)
{
    Record current = GetInScopeRecord();
}