2.8 Errors and warnings
ODBC operations return success, error or‘success with info'. This section explains how results from the ODBC layer are reported to Prolog.
2.8.1 ODBC messages:‘Success with info'
If an ODBC operation returns‘with info', the info is extracted
from the interface and handled to the Prolog message dispatcher print_message/2.
The level of the message is informational
and the term is
of the form:
- odbc(State, Native, Message)
- Here, State is the SQL-state as defined in the ODBC API, Native is the (integer) error code of the underlying data source and Message is a human readable explanation of the message.
2.8.2 ODBC errors
If an ODBC operation signals an error, it throws the exception
error(
. The
arguments of the odbc(State, Native, Message)
, _)odbc/3
term are explained in section
2.8.1.
In addition, the Prolog layer performs the normal tests for proper arguments and state, signaling the conventional instantiation, type, domain and resource exceptions.