The maximum number of concurrently active statements allowed per connection. 0 (zero) means there is no limit.
Database
ODBC only, revision 5 and higher
Integer, temporary
Read/Write
0..
Use cli.pkg
Get_Attribute DF_DATABASE_MAX_ACTIVE_STATEMENTS of {driverNumber} {databaseHandle} to {IntegerVariable}
Set_Attribute DF_DATABASE_MAX_ACTIVE_STATEMENTS of {driverNumber} {databaseHandle} to {IntegerVariable}
The maximum number of concurrently active statements allowed per connection. 0 (zero) means there is no limit.
This attribute can be queried through ODBC, but we have found that some drivers do not return a reliable value. The value of the attribute is used by the driver to determine the size of the statement pool. The driver keeps track of the statements that are used per connection in a 'Most Recently Used' sorted list. If the maximum number of statements is in use, the least recently used statement will be freed whenever an additional statement is required.
Some ODBC drivers return a value of 1 for this attribute. This will make the driver free and re-allocate statements all the time. For some drivers, the value is accurate (MS Jet Engine DataFlex ODBC Driver e.g.) but for others it is not (Oracle ODBC driver e.g.).
Procedure ShowDBAttribute Integer iDriver Handle hDatabase
Integer iAttribValue
Get_Attribute DF_DATABASE_MAX_ACTIVE_STATEMENTS of iDriver hDatabase to iAttribValue
Showln "Max active statements per connection: " (If(iAttribValue = 0, " unlimited", String(iAttribValue)))
End_Procedure
The sample code above shows the current setting for a given database. The database handle can be obtained via the DF_DATABASE_ID attribute.