Next: ODBC Writing, Up: ODBC Datatypes [Contents][Index]
When reading data from the database the following datatypes are supported, with conversion to the corresponding prolog datatypes.
SQL_CHAR, SQL_VARCHAR etc.A list of character codes.
SQL_BITThe integer 0 for false, or 1 for true.
SQL_INTEGER, SQL_TINYINT, SQL_SMALLINT, etc.An integer.
SQL_REAL, SQL_DOUBLE, SQL_FLOATA floating point number.
SQL_DATEA term date(Year, Month, DayOfMonth), with one-based
integer arguments. E.g. date(2012,10,22) means October
22, 2012.
SQL_TIMEA term time(Hour, Minute, Second) with one-based integer
arguments. E.g. time(22,11,5) means eleven minutes and
five seconds past ten pm.
SQL_TIMESTAMPA term timestamp(Year, Month, Day, Hour, Minute, Second,
Fraction) where the arguments have the same meaning as for
SQL_TIME and SQL_TIMESTAMP and Fraction
means fractional nanoseconds past, as an integer.
The atom null.
SQL_BINARY and other binary typesSQL_INTERVAL_HOUR and other interval typesSQL_UTCTIME and SQL_UTCDATETIMECurrently not supported.
Note that atoms with names that start with an upper case letter,
like SQL_CHAR must be quoted in Prolog, e.g. 'SQL_CHAR'.