SendAllOQLToService()

The SendAllOQLToService(); stitcher rule sends all the records in a variable of type RecordList to another service. Use this rule to more efficiently send a batch of OQL instructions over the network rather than several individual OQL requests.

Example

The SendAllOQLToService(); statement uses following syntax.

SendAllOQLToService(service_name,variable,oql string,test stitcher );

Arguments

The following table lists the properties of the arguments of this stitcher rule.
Table 1. Arguments of SendAllOQLToService()
Argument Description Accepts constants Accepts variables Accepts eval clauses
service name Name of the process to send results to. Available strings can be found by running the command ncp_oql -options. Yes No No
variable Variable to send the records from. No Yes No
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 No Yes
test stitcher Stitcher to invoke for each record inserted. Yes No No

Example

In the following example, SomeScript.pl is a script that you want to run against multiple entities. ScriptDataFilter is a stitcher that verifies that the arguments are correct.

SendAllOQLToService(
   "Ctrl",                      // Send OQL to this service
   scriptTargets,                   // Send the records from this variable

   "insert into services.unManaged
       ( serviceName, servicePath, argList, logFile )
   values
       ( 'SomeScript.pl', '$NCHOME/precision/scripts/perl/scripts', 
eval(list type text, '$scriptTargetArgList') , 'someScript.log' );",

   "ScriptDataFilter"        // Invoke this stitcher for each record
        );