skip to main content
OpenAccess SDK SQL Engine core methods for .NET : Methods for .NET reference : dam_getInfo
 

dam_getInfo

This method returns the requested connection and statement level information from the OpenAccess SDK SQL Engine. See Table 149 for the types of information that can be returned.
int dam_getInfo(
int64 hdbc,
int64 hstmt,
int iInfoType,
StringBuilder pStrInfoValue,
out int pIntInfoValue,
out long pInt64InfoValue)
 
Table 148: Parameters for dam_getInfo 
Parameter
Type
Description
IN
 
 
hdbc
int64
The OpenAccess SDK SQL Engine connection handle to be used for connection level options. Set to NULL for statement level options.
hstmt
int64
The statement handle to be used for statement level options. Set to NULL for connection level options.
iInfoType
int
The type of information requested. See Table 149 for a list of options.
OUT
 
 
pStrInfoValue
StringBuilder
String information type is returned in this object.
pIntInfoValue
int
Integer and short integer information types are returned in this object.
pInt64InfoValue
long
Int64 information types are returned in this object.
RETURN
 
 
 
int
Status of the call:
DAM_SUCCESS – retrieved the iInfoType value
DAM_FAILURE – wrong value for iInfoType or the output buffer is not large enough
 
Table 149: dam_getInfo Infotype options  
Information Type
Description
DAM_INFO_BLOCKJOIN_IS_ ENABLED
Statement level information. The return value is a short integer with Value 1 if Block Join is enabled for the query. The value is 0 if Block Join is disabled.
DAM_INFO_CLIENT_ADDRESS
Connection level information. Returns the local IP address of the client as a string of the form 'ddd.ddd.ddd.ddd' (for example, "100.23.24.25". The value is a string of maximum 128 characters. This option can be used while running in DAM_MODE to implement a client IP-based authentication scheme.
DAM_INFO_CLIENT_APPLICATION_
NAME
Connection level information indicating the name of the client application on this connection. The value is an ASCII string of maximum length 128.
DAM_INFO_CLIENT_PRODUCT_
VERSION
Connection level information indicating the version of the client product that the OpenAccess SDK client is accessing for this connection.
The value is a string of maximum 128 characters.
DAM_INFO_CLIENT_PUBLIC_ADDRESS
Connection level information. Returns the public IP address of the client as a string of the form 'ddd.ddd.ddd.ddd' (for example, "100.23.24.25". The value is a string of maximum 128 characters. This option can be used while running in DAM_MODE to implement a client IP-based authentication scheme.
DAM_INFO_CLIENT_TYPE
Connection level information indicating the OpenAccess SDK client type for this connection. The value is a short integer. The possible values are:
DAM_CLIENTTYPE_ODBC
DAM_CLIENTTYPE_JDBC
DAM_CLIENTTYPE_OLEDB
DAM_CLIENTTYPE_NET
DAM_INFO_CONNECTION_ALIVE
Connection level information. This value is returned as a short integer. A value 0 is returned if connection is not active. The IP can cancel its operations and return DAM_FAILURE. The SQL Engine then closes the connection.
Note that the ServiceSQLCheckConnectionAlive service attribute must be enabled to support this feature. The default is Enable. Refer to the OpenAccess SDK Administrator’s Guide for more information about the ServiceSQLCheckConnectionAlive attribute.
DAM_INFO_CONNECTION_MODEL
Global information (set hstmt to NULL). Returns a short integer value indicating the threading mode of the service associated with this data source. The threading modes are:
DAM_CONNECTMODEL_THREADPOOL
DAM_CONNECTMODEL_PROCESS
DAM_CONNECTMODEL_THREAD
DAM_INFO_DAM_HDBC
Statement level information. Returns the connection handle for the given statement. The value is returned as void *. This must be casted to DAM_CONN_DA pointer.
DAM_INFO_DISTINCT_OPTIMIZABLE
The statement level information. The return value is greater than 0 if the current query has a SELECT DISTINCT clause that can be processed by the IP. The value is returned as a short integer. If the IP decides to handle the DISTINCT processing then it should call the dam_setOption to set the DAM_STMT_OPTION_DISTINCT to DAM_PROCESS_OFF.
DAM_INFO_ESTIMATED_NUM_ SUBQUERIES
Statement level information. Returns the expected number of subqueries to process the given query. The value returned is an int data type.
DAM_INFO_FETCH_BLOCK_SIZE
Connection level information for the number of rows to be fetched each time EXECUTE is called. This information is used if the IP is implementing cursor based select processing. The value is returned as a short integer.
DAM_INFO_GROUP_BY_OPTIMIZABLE
The statement level option. The returned value is greater than 0 if the current query has a GROUP BY clause that can be processed by the IP. This value is a short integer and it indicates the number of columns in the GROUP BY clause. Use dam_getGroupByCol to get information about the columns in the GROUP BY statement.
DAM_INFO_IP_CLASS
Connection level information. Returns the DataSourceIPClass attribute value. The value is an ASCII string of maximum length 128.
DAM_INFO_IP_SUPPORT_UNICODE_ INFO
Connection level information. Returns a value that indicates that the IP supports Unicode options in ipGetInfo and
ipSetInfo. The value returned is of a short data type.
DAM_INFO_JOIN_QUERY_SIZE
The statement level option. Returns the size (in the number of tables) of the join query being processed. This value is returned as a short integer. A value of 1 is returned if the query is a simple single table select.
The IP can call this method from EXECUTE to check if the current query being processed is part of a join and call dam_getInfo (DAM_INO_QUERY_PROCESS_ORDER) to get the process order of the current table.
DAM_INFO_LANGUAGE_ID
Connection level information. Returns the LANGUAGE ID. The value returned is an ASCII string having a maximum length of 128 characters.
DAM_INFO_LOGFILE
Connection level information. Returns the LOG file name. The value returned is an ASCII string having a maximum length of 128 characters.
DAM_INFO_MODE
Global information (set hdbc and hstmt to NULL). Returns a short integer with the value DAM_MODE_SERVER or DAM_MODE_LOCAL to indicate if the IP module has been loaded by an OpenAccess SDK Server or an OpenAccess SDK Local Server. Use this information to control the behavior of your IP for standalone operation and for client/server operation without having to have separate builds.
DAM_INFO_OASQL_INI
Global information (set hdbc and hstmt to NULL). Returns the path and the file name that is being used for the OpenAccess SDK configuration information. The information is returned as a character string.
DAM_INFO_ORDER_BY_OPTIMIZABLE
The statement level option. The returned value is greater than 0 if the current query has an ORDER BY clause that can be processed by the IP. This value is a short integer and it indicates the number of columns in the ORDER BY clause. Use dam_getOrderByCol( ) to get information about the columns in the ORDER BY statement.
DAM_INFO_ORIGINAL_QUERY_STRING
The statement level information. Retrieves the SQL string as specified by the application. The information is returned as a wide character string. Can be used to implement your own logging of queries.
DAM_INFO_OUTER_TABLE_ CUR_ROWCOUNT
Statement level information. Returns the outer table current rowcount. If query is not a join, 0 is returned.
When the IP is processing inner query, it can get row count of outer table. The IP can use this information to decide if inner table can be processed as TableRowset. If outer table row count is a small number like 1, the IP can process the inner query directly and not use TableRowset.
The return value is a 64-bit integer.
DAM_INFO_PASSTHROUGH_QUERY
Statement level information. The return value is greater than 0 if the current query is being executed in pass-through mode. The value is a short integer.
DAM_INFO_QUERY_CANCEL
Statement level information. The return value is greater than 0 if the current query execution was requested to be cancelled. The value is a short integer. When the IP detects a CANCEL request, it must clean up its resources that were allocated to handle this statement and return a DAM_FAILURE.
DAM_INFO_QUERY_HAS_NOWAIT
The statement level information. Used to determine whether to wait or not to wait when a row needs to be locked but it is already locked. Indicates whether the NOWAIT clause was specified in the SELECT FOR UPDATE statement. The return value is a short integer 1 if there is a NOWAIT clause and 0 otherwise.
DAM_INFO_QUERY_HAS_SEARCH_ CONDITION
The statement level information. Indicates whether a statement has a WHERE clause. This can be used to detect operations that are on the entire table. The return value is a short integer 1 if the statement has a WHERE clause and 0 if the statement does not have a WHERE clause.
DAM_INFO_QUERY_MAX_ROWS
Statement level information. Returns the least of MaxRows or TOP N value provided in the query. The value returned is an int64 data type.
DAM_INFO_QUERY_IS_NESTED
The statement level option. This method will return a short integer 1 if the current statement represents a inner query and it will return 0 if it represents an outer query. If the outer query is a join, then all queries on the tables in the join list are considered to be outer queries. For example, in the query: SELECT * FROM emp WHERE dept_id IN (SELECT dept_id FROM dept WHERE location=’SJ’), the dept table is considered an inner query.
DAM_INFO_QUERY_PROCESS_ORDER
The statement level option. When executing a JOIN on M tables, the returned value indicates which of the M tables is being processed. A value of zero is returned for the first table and a value of M-1 for the last table. This value is returned as a short integer.
DAM_INFO_QUERY_TIMEOUT
The statement level option. Returns the query timeout value in seconds. This value is returned as an integer. A value of 0 is returned if query does not have a timeout set.
DAM_INFO_QUERY_TOP_ROWS
Statement level information. For a query containing a TOP N clause, the return value is N if the TOP N can be pushed down to the IP. The value is 0 (DAM_MAX_ROWS_UNLIMITED) if the query does not have TOP N option or the option cannot be exposed to the IP. The value is a 64-bit integer.
DAM_INFO_QUERY_TYPE
The statement level information. Returns the type of query being processed. The query type value is returned as a short integer that is one of the constants defined for the statement type in the EXECUTE method.
DAM_INFO_RM_GUID
Connection level information. Retrieves the resource manager ID of the current MTS transaction. The information is returned as a character string of 36 characters. This information is not available during a ipStartTransaction IP call.
DAM_INFO_SCHEMA_PATH
Connection level information. Retrieves the schema path for the connection. The information is returned as a character string.
DAM_INFO_SERVICEIPPATH
Connection level information. Returns the path for the C IP files as set in the ServiceIPPath attribute. The value is an ASCII string of maximum length 256.
DAM_INFO_SESSION_CIPHER_SUITE
Connection level information. Returns the cipher suite used for communication between the OpenAccess SDK client and server.
The value returned is a string data type.
DAM_INFO_SESSION_CRYPTO_
PROTOCOL_VERSION
Connection level information. Returns the cryptographic protocol version that can be used to create an SSL connection between the OpenAccess SDK client and server.
The value returned is an integer data type.
Valid or expected values are the following SSL/TLS versions:
DAM_VERSION_UNDEFINED – 0
DAM_VERSION_TLS1 – 1
DAM_VERSION_TLS1_1 – 2
DAM_VERSION_TLS1_2 – 3
Default when SSL Enabled
DAM_VERSION_TLS1_2 – 2
DAM_INFO_SESSION_TOKEN
Connection level information. Returns session token as defined by the DataSourceSessionToken attribute. The value is an ASCII string of maximum length 1024.
For example:
Session from $ClientInfo connected to $DataSourceName
DAM_INFO_SET_FUNCTIONS_IN_ QUERY
Statement level information. Returns the number of set functions in the given query. The value returned is an int data type.
DAM_INFO_SETLOCALE
Connection level information. Returns the LOCALE information of the client. The value returned is an ASCII string having a maximum length of 128 characters.
DAM_INFO_STMT_IP_CONTEXT
The statement level information. Retrieves the context information stored for the entire query. The returned value is an integer.
DAM_INFO_TXN_ID
Connection level information. Retrieves the transaction ID of the current MTS transaction. The information is returned as a character string of 36 characters. This information is not available during startTransaction IP call.
DAM_INFO_TXN_INFO
Connection level information. Retrieves the transaction information associated with the current MTS transaction. The information is returned as a character string of up to 240 characters. This information is not available during a startTransaction IP call.
DAM_INFO_TXN_ISO_LEVEL
Connection level information. Returns the isolation level of the connection. The value returned is an int data type.
DAM_INFO_TXN_NESTING_LEVEL
Connection level information. Returns the nesting level of the transaction. The value returned is of a short data type.
DAM_INFO_TXN_TYPE
Connection level information. Provides information about the current mode of transaction processing. The options are:
DAM_TXN_IMPLICIT – the currently active transaction is a local transaction with AUTO COMMIT ON option set on the connection. In this mode the ODBC driver or ADO data provider generates a COMMIT after each non- SELECT statement. This will result in the ipEndTransaction() being called with the specified option. This will then be followed by an ipStartTransaction() call to start a new transaction.
DAM_TXN_EXPLICIT – the currently active transaction is a local transaction with AUTO COMMIT OFF. In this mode the application must call COMMIT or ROLLBACK. This will result in the ipEndTransaction() being called with the specified option, which will be followed by an ipStartTransaction() to start a new transaction.
DAM_INFO_USER
Connection level information. Returns the user name of the connection. The value returned is an ASCII string having a maximum length of 128 characters.

See also 

dam_getOrderByCol
dam_getGroupByCol
dam_getInfo