ODBC data types Professional
The ODBCDBE supports numerous data types that may be available in data sources accessible via the ODBC 3.0 standard. Which data types are present in a table depends on the data source and/or the table definition, or table structure. A description of the data types recognized by the ODBCDBE is given in the following table.
ODBC-type | Description |
---|---|
SQL_BIGINT | Exact numeric value without decimal places Range: signed -2^63 to 2^63-1, unsigned 0 to 2^64-1 |
SQL_BINARY | Binary data of fixed length. |
SQL_BIT | Single bit value. |
SQL_CHAR | Character data of fixed length. |
SQL_DATETIME | Date value Format: YYYYMMDD. |
SQL_DECIMAL | Signed exact numeric value with fixed number of decimal places. |
SQL_DOUBLE | Signed approximate numeric value with variable number of decimal places. Range: +- 10^-308 to 10^308. |
SQL_FLOAT | Signed approximate numeric value with variable number of decimal places. Range depends on field length. |
SQL_GUID | Globally unique identifier of fixed length. Format: ABCDEFGH-IJKL-MNOP-QRST-UVWXYZ012345 |
SQL_INTEGER | Exact numeric value without decimal places. Range: signed -2^31 to 2^31-1, unsigned 0 to 2^32-1. |
SQL_LONGVARBINARY | Binary data of variable length. The maximum length is data source dependent. |
SQL_LONGVARCHAR | Character data of variable length. The maximum length is data source dependent. |
SQL_NUMERIC | Signed exact numeric value with fixed number of decimal places. |
SQL_REAL | Signed approximate numeric value with variable number of decimal places. Range: +- 10^-38 to 10^38. |
SQL_SMALLINT | Exact numeric value without decimal places Range: signed -2^15 to 2^15-1, unsigned 0 to 2^16-1. |
SQL_TIME | Time value. Format: HHMMSS. |
SQL_TINYINT | Exact numeric value without decimal places Range: signed -2^7 to 2^7-1, unsigned 0 to 2^8-1. |
SQL_TIMESTAMP | Combined date and time value Format is: YYYYMMDDHHMMSSssssssss with ssssssss being fractions of a second. |
SQL_VARBINARY | Binary data of variable length and fixed maximum length. |
SQL_VARCHAR | Character data of variable length and fixed maximum length. |
SQL_WCHAR | Wide character data (unicode) of fixed length. |
SQL_WLONGVARCHAR | wide character data (unicode) of variable length. The maximum length is data source dependent. |
SQL_WVARCHAR | Wide character data (unicode) of variable length and fixed maximum length. |
The SQL_* #define constants in the left column are taken from the ODBC 3.0 SDK. They are used as generic identifiers for data types supported by a data source. When a database is inspected using the database administration tool included in the software providing the data source, the symbolic names of supported data types may differ from the SQL_* constants.
Length of numeric fields
The length of numeric fields exposed by a database administration tool for a SQL DBMS usually does not account for a +- sign and the decimal point. This means that a numeric field displayed as (SQL_NUMERIC,2,0) in the administration tool would be represented in Xbase++ by (N,3,0), since the minus sign is included in the field length. Likewise, a numeric field displayed as (SQL_NUMERIC,4,2) is represented in Xbase++ by (N,6,2). In this case, the minus sign and the decimal point are accounted for in the field length.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.