Previous Topic Next topic Print topic


MFHCOCDS Tool

DB2 LUW generally returns the same SQLCODE as DB2 for common errors such as no more rows in table or duplicate index entry. MFHCOCDS is a mapping facility provided to support the translation of DB2 LUW SQLCODE's to their DB2 equivalent for special situations where the mappings are not the same. To enable this facility, create a line sequential text file named mfhcocds.sql in the same directory where your compiled application resides. In the mfhcocds.sql file, identify the DB2 LUW SQL code to be replaced and its equivalent DB2 SQL code to be returned to the application program. Use the following format:

DB2LUWcode DB2SQLcode

For example, if you want to change the SQLCODE -30080 (communication error) to -902 (system error), place the following line of text in the file:

-30080 -902
Previous Topic Next topic Print topic