Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Application Server

aaDBCommand object

  • Last UpdatedJul 22, 2024
  • 2 minute read

Use objects of type aaDBCommand to process SQL statements and stored procedures or to access a single table or view.

Create instances of type aaDBCommand by calling CreateCommand() on an instance of the aaDBConnection object. For example, assuming that the aaDBConnection instance is called Connection:

Connection.CreateCommand()

When a script requests the command object ID, the command object is flagged to be persisted.

The aaDBCommand objects are persisted across scripts and scan cycles but not across failover or shutdown.

Note: You must call Dispose() on each instance of aaDBCommand where an ID was created. You can also call aaDBAccess.RemoveCommand() with the ID.

You can retrieve an aaDBCommand object at any time by calling the static method aaDBAccess.GetCommand() and passing the previously acquired string ID.

The aaDBCommand object provides support for types that make sense for QuickScript. Other types may be supported by database columns, such as large text files or generic binary large objects (BLOBs), but a script might not be able to generate or analyze them. In general, if the script cannot manipulate objects of a particular type, such as a BLOB of type char[] or byte[], it might still be possible to read or write an object of that type to or from some alternate script library while storing it as type object within the script. In these cases, the object may be blindly written to a database using SetCurrentRowColumnByName() or SetCurrentRowColumnByIndex() and may be blindly read from a database using GetCurrentRowColumnByName() or GetCurrentRowCollumnByIndex().

The life cycle of the aaDBCommand object follows this pattern:

  1. The object is created by calling the aaDBConnection.CreateCommand() method.

  2. Parameters are added to the command object as necessary.

  3. The command object is run synchronously or asynchronously.

  4. The dataset object wrapped by the aaDBCommand object is accessed and manipulated. This process may involve writing the dataset object back to the database.

  5. Steps 2 through 4 can be repeated as needed.

TitleResults for “How to create a CRG?”Also Available in