Chapter 12 . DBMS Global Variables

This chapter describes the global variables, in alphabetical order, available in Panther's database drivers.

A reference page for each global variable includes:

Since some variables store engine-specific values, refer to "Database Drivers" for additional information. For more information on using the global variables as part of your error processing, refer to Chapter 37, "Processing Application Errors," in Application Development Guide.


Variable Overview

The global variables available through Panther's database drivers are automatically defined at initialization. All the global variable names used in the database drivers begin with the characters @dm. Since the character @ is not permitted in user-defined Panther variables, these variables will never conflict with any screen, LDB or JPL variables defined by your application.

These variables and their values are available to JPL commands and to Panther library functions like sm_getfield and sm_fptr.

The variables are automatically maintained by Panther. Before executing a DBMS command, Panther clears the contents of all its global variables. After executing the command and before returning control to the application, Panther updates the variables to indicate the current status.

Table 12-1 Error Data

Variable Description

@dmretcode

Error code from Panther's database driver. Codes are the same for all engines.

@dmretmsg

Error message from Panther's database driver. Messages are the same for all engines.

@dmengerrcode

Engine error code. Codes are unique to the engine.

@dmengerrmsg

Engine error message. Messages are unique to the engine. Some engines do not supply messages.

@dmengsqlstate

Engine status code signaling an error condition. Not used by all engines.

Table 12-2 Status Data

Variable Description

@dmretcode

Status code available for "no more rows" or "end of procedure."

@dmretmsg

Status message available for "no more rows" or "end of procedure."

@dmengreturn

Engine return code from a stored procedure. Not used by all engines.

@dmrowcount

Count of the number of rows fetched to Panther by the last SELECT or CONTINUE. Used by all engines.

@dmserial

A serial value returned after inserting a row into a table with a serial column. Not used by all engines.

@dmengwarncode

A code or byte signalling a non-fatal error or unusual condition. Not used by all engines.

@dmengwarnmsg

A message corresponding to an engine warning code. Not used by all engines.

@dmwarnsqlstate

Engine status code signaling a warning condition. Not used by all engines.