ODBC API Support
The following table lists the ODBC API functions supported by the Relational Interface and the ODBC support level. For detailed information on the ODBC API, refer to the Microsoft ODBC documentation.
Exceptions to ODBC API Support
The following section contains details on the exceptions to ODBC API support.
SQLGetData
If your application calls SQLGetData to return data into an SQL_C_NUMERIC structure, the ODBC standard specifies that the SQL_DESC_SCALE field is set to zero and the SQL_DESC_PRECISION field uses the driver-defined precision.
PSQL use the values for scale and driver-defined precision as defined in the metadata. Consider the following example, in which scale is set to two.
CREATE TABLE testnum (col1 NUMERIC(10,2))
INSERT INTO testnum VALUES (10.34)
SELECT * FROM testnum
The SELECT statement returns 10.34, not 10.00.
SQLGetTypeInfo
SQLGetTypeInfo generates a list of native data type names (type_name) specified by the Relational Interface. For example, SQL_CHAR is mapped to CHARACTER. Use the names which are returned from this function for the data type names for columns in a CREATE TABLE or ALTER TABLE statement or for parameters for procedures or declared variables in procedures and triggers.
See Supported Data Types for a list of supported ODBC data types.
SQLGetInfo
The Relational Interface returns identical values for SQL_DRIVER_VER and SQL_DBMS_VER. This version value is returned in the following format:
aa.bb.cccc ddd
This value can be interpreted as four components as explained in the following table:
The following table summarizes the expected format of other values typically returned by SQLGetInfo. The values are examples only.
SQLSpecialColumns
The Relational Interface uses unique indexes as the optimal set of columns that uniquely identifies a row in the table. When a new row is inserted, the Relational Interface does not return the values for IDENTITY columns. You may determine the value for an IDENTITY column through the use of the @@IDENTITY variable. See @@IDENTITY in SQL Engine Reference.