solidDB Help : Programming : solidDB ODBC API : solidDB extensions for ODBC API
  
solidDB extensions for ODBC API
The solidDB server and clients include various and connection attributes that are proprietary extensions to the ODBC API.
Non-standard ODBC functions
 
Function
Description
SQLFetchPrev()
Same as the ODBC function SQLFetch, but for fetching previous record.
SQLGetAnyData()
Same as the ODBC function SQLGetData().
SQLGetCol()
Same as the ODBC function SQLGetData().
SQLSetParamValue()
Sets the value of a parameter marker in the SQL statement specified in SQLPrepare(). Parameter markers are numbered sequentially from left-to-right, starting with one, and can be set in any order.
Non-standard ODBC attributes
The following connection attributes are specific to the solidDB server and clients.
Note If the attribute is marked as OUT, it is a read-only attribute and cannot be set by using the ODBC interface.
SQL_ATTR_AUTHTOKEN_FILE
IN: string
ODBC client reads the authentication token from the file defined by this property.
SQL_ATTR_AUTHTOKEN_STRING
IN: string
ODBC client reads the authentication token from the string defined by this property.
SQL_ATTR_CONNECTION_TIMEOUT_MS
IN/OUT: integer, connection timeout in milliseconds
You can also use a standard attribute SQL_ATTR_CONNECTION_TIMEOUT that to set the timeout in seconds.
SQL_ATTR_HANDLE_VALIDATION (environment handle attribute)
IN/OUT: integer, turns ODBC standard handle validation on (1) or off (0).
Default is 0.
This attribute is global; when set, it affects all the solidDB ODBC connections that are initiated by the application. This ensures consistency by preventing the application from allocating both validated and non-validated handles.
In certain systems, for example in Windows with the ODBC driver manager, the driver manager performs the handle validation and the solidDB ODBC driver does not have to repeat the same validation procedures. Also, a carefully-written ODBC application normally does not cause invalid handles to be used; in that case, the handle validation in the ODBC driver is not needed. In both cases, the applications might benefit from performance improvements when handle validation is skipped by the driver. When handle validation is turned off, and an invalid handle is used by the application, the ODBC driver behavior is unpredictable and might cause the application to crash.
SQL_ATTR_IDLE_TIMEOUT
IN/OUT: integer, connection idle timeout in minutes
Indicates the connection-specific idle timeout to be used by the server. If there is no activity on the connection for specified time period, the server automatically shuts down the connection, effectively throwing out the user.
Special semantics:
-1 (default) - the connection timeout is equal to the server default
0 - no idle timeout, connection is never closed
This property value can be set only before executing SQLConnect().
SQL_ATTR_LOGIN_TIMEOUT_MS
IN/OUT: integer, login timeout in milliseconds
You can also use a standard attribute SQL_ATTR_LOGIN_TIMEOUT to set the timeout in seconds.
SQL_ATTR_QUERY_TIMEOUT_MS
IN/OUT: integer, query timeout in milliseconds
You can also use a standard attribute SQL_ATTR_QUERY_TIMEOUT to set the timeout in seconds.
SQL_ATTR_PA_LEVEL
OUT: integer (Preferred Access level: 0=WRITE_MOSTLY, 1=READ_MOSTLY)
The attribute indicates whether the load balancing is used or not.
SQL_ATTR_SET_CONNECTION_DEAD
IN/OUT: integer, should be set to 1 when needed
When this attribute is set on a connection, it causes the driver to abort the connection forcibly, without a disconnecting handshake with the server. After the attribute is set to 1, the connection becomes unusable.
SQL_ATTR_TC_PRIMARY
OUT: string, primary server connection string
The value indicates the current primary server.
SQL_ATTR_TC_SECONDARY
OUT: string, secondary server connection string
The value indicates the assigned workload server if the following conditions are both true:
PA=READ_MOSTLY
The secondary server is the designated workload server.
Otherwise, the returned string is empty.
SQL_ATTR_TC_WORKLOAD_CONNECTION
OUT: string, server name of the workload connection
The current workload connection server.
If queried before the commit operation, the value indicates the server that will commit the transaction.
If queried as the statement attribute, the value indicates the server that will execute the next statement.
SQL_ATTR_TF_LEVEL
OUT: integer (TF level: 0=NONE, 1=CONNECTION, 3=SESSION)
The failure transparency level.
SQL_ATTR_TF_RECONNECT_TIMEOUT
IN/OUT: integer
The time in milliseconds the driver should wait until it tries to reconnect to the primary in case of switchover or failover.
SQL_ATTR_TF_WAIT_TIMEOUT
IN/OUT: integer
The time in milliseconds the driver should wait for the server to switch state.
SQL_ATTR_TF_WAITING
OUT: string, secondary server connection string.
The value indicates the assigned watchdog (waiting) connection. Waiting connection is used by ODBC driver internally to detect possible loses (for example, crashes or unavailability) of the primary server more quickly. The string is empty if the connection is not a TC connection.
Go up to
solidDB ODBC API