Asynchronous command script
- Last UpdatedJul 22, 2024
- 1 minute read
The scripts in this object show how to use asynchronous SQL processing in the SQLData Script Library. This script is written to use a command object directly on the connection, without using a transaction object. For comparison, see Synchronous transaction script where the example uses the synchronous SQL processing for a command object on a transaction object.
This object is written with two scripts. One script starts asynchronous command processing (the Query script) and the other script polls for asynchronous command completion and results manipulation (the Process script). Both scripts run synchronously with the ArchestrA AppEngine scan. To use the scripts, set the number to search for in the PartNumber User Defined Attribute (UDA) and column whose value is to be read in the ColumnToRead UDA. Signal the script to run by setting the ReadCommand UDA to True. When the script finishes processing, the ColumnReadDone UDA becomes True, and the results are in the ColumnValue UDA.