SQL and API Types Used in Property Definitions
The following tables show the API types recognized by the repository engine, as well as the SQL types. These values appear in the APIType and SQLType properties of a PropertyDef object. For more information about conversion between SQL and API types, see the Microsoft® ODBC documentation. For more information about API and SQL data type descriptions, see Data Types.
The following table identifies API types that map to Transact-SQL. It is recommended that you not use unlisted API types.
API Types
API type | VALUE | Maps to (T-SQL) |
---|---|---|
SQL_C_BINARY* | -2 | Binary or varbinary |
SQL_C_TINYINT | -6 | tinyint |
SQL_C_BIT | -7 | bit |
SQL_C_CHAR | 1 | char or varchar |
SQL_C_LONG | 4 | int |
SQL_C_SHORT | 5 | int |
SQL_C_FLOAT | 7 | real |
SQL_C_DOUBLE | 8 | float |
SQL_C_DATE | 9 | datetime |
SQL_C_TIME | 10 | datetime |
SQL_C_TIMESTAMP | 11 | datetime |
Note For SQL_C_BINARY use an array of unsigned characters. C++ programmers must use VT-UI1.
SQL Types
SQL type | VALUE | Maps to |
---|---|---|
SQL_LONGVARCHAR | -1 | text |
SQL_BINARY | -2 | binary |
SQL_VARBINARY | -3 | varbinary |
SQL_LONGVARBINARY | -4 | image |
SQL_TINYINT | -6 | tinyint |
SQL_BIT | -7 | bit |
SQL_CHAR | 1 | char |
SQL_NUMERIC | 2 | numeric |
SQL_DECIMAL | 3 | decimal |
SQL_INTEGER | 4 | integer |
SQL_SMALLINT | 5 | smallint |
SQL_FLOAT | 6 | float |
SQL_REAL | 7 | real |
SQL_DOUBLE | 8 | real |
SQL_DATE | 9 | datetime |
SQL_TIME | 10 | datetime |
SQL_TIMESTAMP | 11 | datetime |
SQL_VARCHAR | 12 | varchar |
The following table identifies API types that are not supported by repository Automation. You can only store and retrieve unsigned integers. It is recommended that you not use these API types.
API Types - Not Supported
API type | VALUE |
---|---|
SQL_C_UTINYINT | -28 |
SQL_C_STINYINT | -26 |
SQL_C_ULONG | -18 |
SQL_C_USHORT | -17 |
SQL_C_SLONG | -16 |
SQL_C_SSHORT | -15 |