RetrieveSingleOQL()
RetrieveSingleOQL(); rule is a version
of the RetrieveOQL(); rule that returns only the
first result of the OQL query, regardless of how many records are
returned.An optional record can be passed in to be added to the scope
of the OQL query.
Syntax
The RetrieveSingleOQL(); statement
uses following syntax.
RetrieveSingleOQL( oql string [, optional record] );Arguments
The following table lists the properties of the arguments of this stitcher rule.| 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 is added so that it can be dereferenced in the OQL string. | No | Yes | No |
Example
The following example shows how
the RetrieveSingleOQL() rule is used to return only
the first result of the OQL query.
Record singleRow = RetrieveSingleOQL( "select * from disco.config;" )