ServerMsgMask CLI/ODBC and IBM data server driver configuration keyword

Specifies when CLI should request the error message from the server.

db2cli.ini keyword syntax:
ServerMsgMask = 0 | 1 | -2| -1
IBM® data server driver configuration file (db2dsdriver.cfg) syntax:
<parameter name="ServerMsgMask" value=" 0 | 1 | -2| -1"/>
Attention: The IBM data server driver configuration file (db2dsdriver.cfg) syntax is available in Db2 11.5.4 and later.
Default setting:
CLI will check the local message files first to see if the message can be retrieved. If no matching SQLCODE is found, CLI will request the information from the server.
Equivalent connection attribute:
SQL_ATTR_SERVER_MSGTXT_MASK
Usage notes:
This keyword is used in conjunction with the UseServerMsgSP CLI/ODBC and IBM data server driver configuration keyword. The keyword can be set to:
  • 0 (default) = SQL_ATTR_SERVER_MSGTXT_MASK_LOCAL_FIRST. CLI will check the local message files first to see if the message can be retrieved. If no matching SQLCODE is found, CLI will request the information from the server.
  • 1 = SQL_ATTR_SERVER_MSGTXT_MASK_WARNINGS. CLI always requests the message information from the server for warnings but error messages are retrieved from the local message files.
  • -2 = SQL_ATTR_SERVER_MSGTXT_MASK_ERRORS. CLI always requests the message information from the server for errors but warning messages are retrieved from the local message files.
  • -1 = SQL_ATTR_SERVER_MSGTXT_MASK_ALL. CLI always requests the message information from the server for both error and warning messages.