ExecuteStatement (IDatabaseService)

Executes a query or update statement against a database connection, and provides for returning results in either the actual format(s) of the specified parameter(s) or in string format.

In the Configure Method dialog box, click Next to select whether you want to use an existing statement or configure a new statement. In the latter case, clicking the corresponding Edit link opens a dialog box, where you can specify the statement type and provider and then configure the statement itself. Next, specify whether you want results returned in the actual format(s) of the parameter(s) in question (Return typed values, the default) or string format (Return values as strings), and then click Finish.
Note: Beginning with release 2.2 SP1, this method includes a new parameter (ConvertValues) that allows you to specify whether returned values should be automatically converted to string format, as was done in past releases. Prior implementations of this method will continue to function as in the past.
InputsData TypeDescription
ConnectionDirectoryResourcesSpecifies the database connection that is used to execute a particular statement.
StatementStatementInfoSpecifies the statement information to execute:
  • Statement (select, update, insert, delete)
  • Statement Type (query, update)
  • Provider (SQL, ODBC)
ConvertValuesBooleanSpecifies whether to convert returned values to string format. Options are as follows:
  • False, to leave returned values in their native data formats (the default).
    Note: In the Configure Method dialog box, this option equates with Return typed values.
  • True, to convert returned values from their native data formats to string format.
    Note: In the Configure Method dialog box, this option equates with Return values as strings.

OutputsData TypeDescription
ReturnValueStatementExecutionResultThe execution result, including execution time, affected rows, and collection of DataTable (Result), of the statement against a particular database. Affected rows are provided based on statement type, particularly when StatementType is Update.
Note: Data transfer limit: 10 MB.