?
)
and unify Statement with a handle to the created statement. Parameters
is a list of descriptions, one for each parameter. Each parameter
description is one of the following:
- default
- Uses the ODBC function SQLDescribeParam() to obtain information about
the parameter and apply default rules. See section
2.7 for details. If the interface fails to return a type or the type
is unknown to the ODBC interface a message is printed and the interface
handles the type as text, which implies the user must supply an atom.
The message can be suppressed using the
silent(true)
option of odbc_set_connection/2. An alternative mapping can be selected using the > option of this predicate described below. - SqlType(Specifier, ...)
- Declare the parameter to be of type SqlType with the given
specifiers. Specifiers are required for
char
,varchar
, etc. to specify the field-width. When calling odbc_execute/[2-3], the user must supply the parameter values in the default Prolog type for this SQL type. See section 2.7 for details. - PrologType > SqlType
- As above, but supply values of the given PrologType, using
the type-transformation defined by the database driver. For example, if
the parameter is specified as
atom > date
The use must supply an atom of the format
YYYY-MM-DD
rather than a termdate(Year,Month,Day)
. This construct enhances flexibility and allows for passing values that have no proper representation in Prolog.
Options defines a list of options for executing the statement. See odbc_query/4 for details. In addition, the following option is provided:
- fetch(FetchType)
- Determine the FetchType, which is one of
auto
(default) to extract the result-set on backtracking orfetch
to prepare the result-set to be fetched using odbc_fetch/3.