Network Problems and Workarounds
Each time an ODBC function is called, there are two error codes that can be returned: a native database error code and an ODBC-defined SQL state error code. The database error code is database-specific, but the SQL state is a generic error code that is common between different ODBC drivers. For example, when the database server is unavailable because of a network problem, SQL Server may return a 105 error code. In the same situation, Oracle may return a 6034 or a 3140 error code. But in all cases, the SQL state should be 08S01. By using these pre-defined SQL states, the SQL task can detect when a connection is lost and shift into backup mode.
However, in many cases, ODBC drivers do not set the SQL state correctly. To work around this problem, iFIX provides a text file called SQLERR.TXT. You can list all of your database system errors that correspond to a communication failure in this file. If the ODBC driver does not set the SQL state correctly, the SQL task scans the SQLERR.TXT file for a match. If it finds a match, it knows a communication failure has occurred. If it doesn't, the error is processed as a non-communication error.
NOTE: You may receive an wsqlodc.exe application error when using Mission Control to stop an SQL query or to shut down iFIX. If this happens, you can still start this task and log SQL data without error.
Use the following format when editing the SQLERR text file:
! This is a comment
! General SQL*net errors for Oracle
2034
6000,6499
!
! Two-task interface errors for Oracle
3100,3199
!
! SQL Server SPX Cable break errors
237
238
You can define a single error number or an error range. In the preceding example, if Oracle returned error code 2034, or any error between 6000-6499 or 3100-3199, the SQL task would interpret the error as a communication failure.
The SQLERR.TXT file installs to the Application path, usually C:\Program Files (x86)\Proficy\iFIX\App. Do not rename this file.