Contains an engine-specific status code for error conditions
Some database engines support a
SQLSTATEstatus code which is updated after each SQL statement.
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 which 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 @dmretcode to check for errors in Panther's database drivers.
Because the value of
@dmengsqlstateis 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.
@dmengsqlstateis set to
DBMSstatement. If you need its value for further processing, it should be copied to another variable.