:- use_module(library(odbc)).(can be autoloaded)
read, tell the driver we only access the database in read mode. If
update(default), tell the driver we may execute update commands.
true(default), each update statement is committed immediately. If
false, an update statement starts a transaction that can be committed or rolled-back. See section 2.3 for details on transaction management.
- I haven't found a good description of what this does, but setting it to
dynamicmakes it possible to have multiple active statements on the same connection with Microsoft SQL server. Other values are
- Define the encoding used to communicate to the driver. Defined values
are given below. The default on MS-Windows is
unicodewhile on other platforms it is
utf8. Below, the *A() functions refer to the `ansi' ODBC functions that exchange bytes and the *W() functions refer to the `unicode' ODBC functions that exchange UCS-2 characters.
- Communicate using the *A() functions and pass bytes untranslated.
- Communicate using the *A() functions and translated between Prolog Unicode characters and their (possibly) multibyte representation in the current locale.
- Communicate using the *A() functions and translated between Prolog Unicode characters and their UTF-8 encoding.
- Communicate using the *W() functions.
false), statements returning
SQL_SUCCESS_WITH_INFOsucceed without printing the info. See also section 2.7.1.
- Defines how the SQL constant NULL is represented. Without specification,
the default is the atom
$null$. NullSpecifier is an arbitrary Prolog term, though the implementation is optimised for using an unbound variable, atom and functor with one unbound variable. The representation
null(_)is a commonly used alternative.
The specified default holds for all statements executed on this connection. Changing the connection default does not affect already prepared or running statements. The null-value can also be specified at the statement level. See the option list of odbc_query/4.
- If the width of a column exceeds Length, use the API SQLGetData() to get the value incrementally rather than using a (large) buffer allocated with the statement. The default is to use this alternate interface for columns larger than 1024 bytes. There are two cases for using this option. In time critical applications with wide columns it may provide better performance at the cost of a higher memory usage and to work around bugs in SQLGetData(). The latter applies to Microsoft SQL Server fetching the definition of a view.