![]() | ![]() | Programming Guide |
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 Prolifics, warning conditions fromSQLSTATEare written to @dmwarnsqlstate; error conditions are written to@dmengsqlstate.If the database engine does not support
SQLSTATE, the value of@dmengsqlstatewill be 0, the value which represents success.A 0 (zero) value in this variable does not guarantee that the last statement executed without error. Some errors are detected by Prolifics's database driver before a request is made to the engine. For example, if an application attempts a
SELECTbefore declaring a connection, Prolifics detects the error. Use the global variable@dmretcodeto check for errors in Prolifics'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 process ing.@dmengsqlstate, like all @dm variables, is set to 0 before each DBMS statement. If you need its value for further processing, it should be copied to another variable.
![]()
![]()
![]()
![]()