solidDB Help : Programming : solidDB ODBC API : Error text format
  
Error text format
Error messages that are returned by SQLError() come from two sources: data sources and components in an ODBC connection. The error text must use a specific format, that depends on where the error is generated.
Typically, data sources do not directly support ODBC. Consequently, if a component in an ODBC connection receives an error message from a data source, it must identify the data source as the source of the error. It must also identify itself as the component that received the error.
If the source of an error is the component itself, the error message must explain this. Therefore, the error text that is returned by SQLError() has two different formats: one for errors that occur in a data source and one for errors that occur in other components in an ODBC connection.
For errors that do not occur in a data source, the error text must use the format:
[vendor_identifier][ODBC_component_identifier] component_supplied_text
For errors that occur in a data source, the error text must use the format:
[vendor_identifier][ODBC_component_identifier]
[data_source_identifier] data_source_supplied_text
Note The brackets [ ] are included in the error text; they do not indicate optional items.
The following table shows the meaning of each element.
 
Element
Meaning
vendor_identifier
Identifies the vendor of the component in which the error occurred or that received the error directly from the data source.
ODBC_component_identifier
Identifies the component in which the error occurred or that received the error directly from the data source.
data_source_identifier
Identifies the data source. For single-tier drivers, this is typically a file format. For multiple-tier drivers, this is the DBMS product.
component_supplied_text
Generated by the ODBC component.
data_source_supplied_text
Generated by the data source.
Sample error messages
The following examples show how various components in an ODBC connection might generate the text of error messages and how solidDB returns them to the application with SQLError().
 
SQLSTATE
Error message
01000
General warning
01S00
Invalid connection string attribute
08001
Client unable to establish connection
SQLSTATE values are strings that contain five characters; the first two are a class value, followed by a three-character subclass value. For example 01000 has 01 as its class value and 000 as its subclass value. Note that a subclass value of 000 means there is no subclass for that SQLSTATE. Class and subclass values are defined in SQL-92.
 
Class value
Meaning
01
Indicates a warning and includes a return code of SQL_SUCCESS_WITH_INFO.
Error class 01 returns both warnings and errors.
01, 07, 08, 21, 22, 23, 24, 25, 28, 34, 3C, 3D, 3F, 40, 42, 44, HY
Indicates an error that includes a return value of SQL_ERROR.
Error class 01 returns both warnings and errors.
IM
Indicates warning and errors that are derived from ODBC.
See
Processing error messages
Go up to
solidDB ODBC API