Statement Attributes - ODBC Driver for Teradata

ODBC Driver for Teradata User Guide

Product
ODBC Driver for Teradata
Release Number
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-07-11
dita:mapPath
smj1488824663219.ditamap
dita:ditavalPath
Audience_PDF_product_legacy_odbc_include.ditaval
dita:id
B035-2526
lifecycle
previous
Product Category
Teradata Tools and Utilities

The following table lists the statement attributes and their associated values.

Statement Attributes  
Statement Attribute ValuePtr Contents
SQL_ATTR_AGKR An SQLUINTEGER value that determines the result from requests that insert into identity columns (INSERT, INSERT ... SELECT, UPSERT, MERGE-INTO). These requests can optionally return a result set containing identity column values (also known as auto-generated keys) for the inserted rows.
Values supported are as follows:
  • SQL_AGKR_NO
  • SQL_AGKR_IDENTITY_COLUMN
  • SQL_AGKR_WHOLE_ROW

This statement level attribute inherits and overrides the connection level SQL_ATTR_AGKR setting.

SQL_ATTR_DATA_ENCRYPTION This SQLINTEGER statement attribute turns ON/OFF data encryption at statement level. All the transactions done under a statement handle are affected.
Values supported are as follows:
  • SQL_DATA_ENCRYPTION_ON
  • SQL_DATA_ENCRYPTION_OFF

This statement-level attribute overrides the connection-level data encryption option. For example, encryption can be turned ON or OFF with this attribute for a particular statement handle regardless of the connection-level setting. All other statement handles under the same connection handle use data encryption as per the default connection level setting.

SQL_ATTR_TDATA_ROWCOUNT This attribute is an unsigned bigint (SQLUBIGINT) and lets 32-bit applications obtain the row count even if it is greater than the maximal signed integer (0x7FFFFFFF).
SQL_ATTR_TRUSTED_SQL SQL_ATTR_TRUSTED_SQL is an SQLUINTEGER value.
Values supported are as follows:
  • SQL_TRUE
  • SQL_FALSE

SQL_ATTR_TRUSTED_SQL attribute can be used to specify if the next SQL that is executed(either through SQLExecute or SQLExecDirect) is trusted or not trusted.

Note that the value of SQL_ATTR_TRUSTED_SQL is SQL_FALSE by default, and it will be reset back to SQL_FALSE after any SQLExecute or SQLExecDirect is made.

The SQL_ATTR_TRUSTED_SQL attribute is a statement attribute.

When calling SQLSetStmtAttr() or SQLGetStmtAttr() you must pass in the value SQL_IS_UINTEGER for the StringLength or BufferLength argument respectively.

See also the section on Trusted Sessions .