Contains an engine-specific status code for error conditions
Some database engines support a
SQLSTATEstatus code which is updated after each SQL statement.
SQLSTATEis currently supported by Panther's ODBC, Informix and DB2 drivers.
SQLSTATEis a five-character string which can be set for warning or error conditions. In Panther, warning conditions from
SQLSTATEare written to
@dmwarnsqlstate; error conditions are written to
If the database engine does not support
SQLSTATE, the value of
"00000", the value that represents success.
"00000"(five zeros) value in this variable does not guarantee that the last statement executed without error. Some errors are detected by Panther's database driver before a request is made to the engine. For example, if an application attempts a
SELECTbefore declaring a connection, Panther detects the error. Use the global variable
@dmretcodeto check for errors in Panther's database drivers.
Because the value of
@dmerrsqlstateis engine-specific, it is strongly recommended that you install an error handler to test for these errors.
If the application accesses multiple database engines, the database driver for each engine must support
SQLSTATEin order to use its values for application processing.
@dmerrsqlstateis set to
DBMSstatement. If you need its value for later processing, it should be copied to another variable.