When writing data to the database the following SQL datatypes are supported.
SQL_CHAR
, SQL_VARCHAR
etc.For backwards compatibility only, an atom is also accepted, but
note that the atoms null
and []
have special meaning
(as SQL null value and empty code list, respectively) and more
atoms with special meaning may be introduced in the future. For
compatibility with some ODBC drivers, the integer 0 and 1 are
allowed, meaning "0" and "1".
SQL_BIT
0
for false, or 1
for true.
SQL_INTEGER
, SQL_TINYINT
, SQL_SMALLINT
, etc.SQL_REAL
, SQL_DOUBLE
, SQL_FLOAT
SQL_DATE
date(Year, Month, DayOfMonth)
, as above.
SQL_TIME
time(Hour, Minute, Second)
, as above.
SQL_TIMESTAMP
timestamp(Year, Month, Day, Hour, Minute, Second,
Fraction)
, as above.
null
.
SQL_BINARY
and other binary typesSQL_INTERVAL_HOUR
and other interval typesSQL_UTCTIME
and SQL_UTCDATETIME
SQL_SMALLINT
, the
result is undefined.
Note that atoms with names that start with an upper case letter,
like SQL_CHAR
must be quoted in Prolog, e.g. 'SQL_CHAR'
.