ExecuteOQL()

The ExecuteOQL(); rule tells the stitcher to execute an OQL statement on the databases of the current service. For example, if this rule is run from a discovery stitcher, then the current service is the Discovery engine, ncp_disco.

Syntax

The ExecuteOQL(); statement uses following syntax.

ExecuteOQL( oql string, [optional record]  );

Arguments

The following table lists the properties of the arguments of this stitcher rule.
Table 1. Arguments of ExecuteOQL()
Argument Description Accepts constants Accepts variables Accepts eval clauses
oql string The 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 Only within the OQL string.
optional record An optional record that can be passed in to be added to the scope of the OQL query. No Yes No

Example

The following example shows how the ExecuteOQL() rule is used to delete all the records in the finders.pending table.

text oqlDelete = "delete * from finders.pending;";
ExecuteOQL( oqlDelete );
In the following example, the optional record is added to the symbol table used for the OQL statement, and can be accessed within the OQL statement using a single ampersand. Here the record myRecord contains the field m_TableName.
text oqlDelete = "delete * from finders.pending;";
ExecuteOQL( "delete from eval(int, &m_TableName);", myRecord );