Process script code
- Last UpdatedJul 22, 2024
- 1 minute read
Use the following sample code for the Process script.
DIM Command as aaDBClient.aaDBCommand;
'Retrieve the command object using its ID.
Command = aaDBAccess.GetCommand(me.CommandID);
if Command <> null then
'Poll for command complete
if Command.ExecutionState <> aaDBCommandState.Queued then
LogMessage("Command execution state is " + Command.ExecutionState);
if Command.ExecutionState == aaDBCommandState.Completed then
DIM Rows as integer;
Rows = Command.RowCount;
LogMessage("Row count returned from command is " + Rows);
'We expect one row, use the first one, if we have any.
if Rows > 0 then
LogMessage("Getting column '" + me.ColumnToRead + "' from row 0");
Command.SelectRow(0);
'Return the requested column value from this row, signal done.
me.ColumnValue = Command.GetCurrentRowColumnByName(me.ColumnToRead);
me.ColumnReadDone = true;
endif;
endif;
'When done, dispose the command.
Command.Dispose();
'Reset for next time
me.ProcessCommand = false;
endif;
else
LogMessage("Cannot find command " + me.CommandID);
me.ProcessCommand = false;
endif;