Enforce Single Statement

EnforceSingleStatement

Key Name Default Value Required

EnforceSingleStatement

Clear (0)0

No

Description

This option specifies whether the connector returns SQL_ERROR immediately for any other queries that is executed if there is already an active query in execution under the same connection. The connector allows applications to allocate more than one statement handles and execute queries in each statement handle concurrently per connection. However, the connector allows only one active statement at a time for each connection.

  • Enabled (1)1: The connector allows one active query to be executed at a time. If there is already an active query in execution under the same connection, the connector returns SQL_ERROR immediately for any other queries that is executed if there is already an active query in execution under the same connection.
  • Disabled (0)0: The connector allows more than one queries to be executed at a time, but all queries are still sent and executed sequentially. If there is already an active query in execution under the same connection, the connector blocks queries in other statement handles from execution until the active query finishes execution and retrieves all the data, or when the application calls SQLCloseCursor or SQLFreeHandle with a HandleType of SQL_HANDLE_STMT to indicate that the statement handle can be freed.
Note:

Note:

  • If Enforce Single Statement and Use Multiple Statements are both enabled, Use Multiple Statements Mode takes precedence.

  • The connector only allows multiple queries to be execute sequentially when the statement handles are allocated in different threads. If there is already an active query in execution under the same connection and the queries to be executed belong to statement handles that are allocated within the same thread, the connector returns SQL_ERROR immediately. For more information, see Query Processing Modes.