An application calls SQLGetTypeInfo to determine which data types are supported by a data source and the characteristics of those data types. The following tables show a sample result set returned by SQLGetTypeInfo for a data source that supports SQL_CHAR, SQL_LONGVARCHAR, SQL_DECIMAL, SQL_REAL, SQL_DATETIME, SQL_INTERVAL_YEAR, and SQL_INTERVAL_DAY_MONTH.
TYPE_ NAME |
DATA_ TYPE |
COLUMN_ SIZE |
LITERAL_ PREFIX |
LITERAL_ SUFFIX |
CREATE_ PARAMS |
NULL- ABLE |
"char" | SQL_CHAR | 255 | "'" | "'" | "length" | SQL_ TRUE |
"text" | SQL_LONG VARCHAR |
2147483647 | "'" | "'" | <Null> | SQL_ TRUE |
"decimal" | SQL_ DECIMAL |
28 | <Null> | <Null> | "precision, scale" |
SQL_ TRUE |
"real" | SQL_ REAL |
7 | <Null> | <Null> | <Null> | SQL_ TRUE |
"datetime" | SQL_TYPE_ TIMESTAMP |
23 | "'" | "'" | <Null> | SQL_ TRUE |
"INTER- VAL YEAR() TO YEAR" |
SQL_ INTERVAL_ YEAR |
9 | "'" | "'" | "precision" | SQL_ TRUE |
"INTER- VAL DAY() TO FRAC- TION(5)" |
SQL_ INTERVAL_ DAY_TO_ SECOND |
24 | "'" | "'" | "precision" | SQL_ TRUE |
CASE_ SENSI- TIVE |
SEARCH- ABLE |
UNSIGNED_ ATTRIBUTE |
FIXED_ PREC_ SCALE |
AUTO_ UNIQUE_ VALUE |
LOCAL_ TYPE_ NAME |
|
SQL_CHAR | SQL_ FALSE |
SQL_ SEARCH- ABLE |
<Null> | SQL_ FALSE |
<Null> | "char" |
SQL_LONG VARCHAR |
SQL_ FALSE |
SQL_ PRED_ CHAR |
<Null> | SQL_ FALSE |
<Null> | "text" |
SQL_ DECIMAL |
SQL_ FALSE |
SQL_ PRED_ BASIC |
SQL_ FALSE |
SQL_ FALSE |
SQL_ FALSE |
"decimal" |
SQL_ REAL |
SQL_ FALSE |
SQL_ PRED_ BASIC |
SQL_ FALSE |
SQL_ FALSE |
SQL_ FALSE |
"real" |
SQL_TYPE_ TIMESTAMP |
SQL_ FALSE |
SQL_ SEARCH- ABLE |
<Null> | SQL_ FALSE |
<Null> | "datetime" |
SQL_ INTERVAL_ YEAR |
SQL_ FALSE |
SQL_ SEARCH- ABLE |
<Null> | SQL_ FALSE |
<Null> | "INTER- VAL YEAR() TO YEAR" |
SQL_ INTERVAL_ DAY_TO_ SECOND |
SQL_ FALSE |
SQL_ PRED_ BASIC |
<Null> | SQL_ FALSE |
<Null> | "INTER- VAL DAY() TO FRAC- TION(5)" |
MIN- IMUM_ SCALE |
MAX- IMUM_ SCALE |
SQL_ DATA_ TYPE |
SQL_ DATE- TIME_ SUB |
NUM_ PREC_ RADIX |
INTER- VAL_PRE- CISION |
|
SQL_CHAR | <Null> | <Null> | SQL_ CHAR |
<Null> | <Null> | <Null> |
SQL_LONG VARCHAR |
<Null> | <Null> | SQL_ LONG- VARCHAR |
<Null> | <Null> | <Null> |
SQL_ DECIMAL |
0 | 28 | SQL_ DECIMAL |
<Null> | 10 | <Null> |
SQL_ REAL |
<Null> | <Null> | SQL_ REAL |
<Null> | 10 | <Null> |
SQL_ TYPE_ TIME- STAMP |
3 | 3 | SQL_ DATE- TIME |
SQL_ CODE_ TIME- STAMP |
<Null> | 12 |
SQL_ INTERVAL_ YEAR |
0 | 0 | SQL_ INTERVAL |
SQL_ CODE_ INTERVAL YEAR |
<Null> | 9 |
SQL_ INTERVAL_ DAY_TO_ SECOND |
5 | 5 | SQL_ INTERVAL |
SQL_ CODE_ INTERVAL DAY_TO_ SECOND |
<Null> | 9 |