SQL Errors

SQL Errors

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

SQL Errors

Execution Error Conditions

The execution environment of a Zim client-server application involves products from more than one vendor. This can introduce the potential for additional error situations. For example, if the parameters to the connect command are not specified correctly for the particular installation of the SQL server being used, then the connect command fails and returns an error code. If the initialization or execution environment requirements of a specific SAM have not been properly established, errors can be generated. The following topics address the types of error conditions that can occur and how they are handled.

The Deadlock Error Condition

Because Zim Client-Server applications are implicitly multi-user, the deadlock error condition can occur in an otherwise properly executing application. Each Server Access Module (SAM) detects the deadlock error condition from the SQL server it supports and translates the error into a Zim deadlock “$ ErrCode” value 2010. Accordingly the “ON DEADLOCK” exception handler can be used to handle deadlock conditions in a manner appropriate to the requirements of the application.

For more information, see Multiple Locking.

Errors from SQL Servers

Some SQL servers generate return codes distinguishing between error and warning conditions. If a server supports this distinction, then the “$ErrCode” reflected to the Zim Client-Server application also distinguishes between errors and warnings. Hence, the Zim “ON ERROR” and “ON WARNING” exception handlers can be used.

If the server does not support such a differentiation, then a Zim error condition is generated into “$ErrCode”.

In either case, $SQLErrCode contains the actual SQL server error code and $SQLErrMsg contains the SQL server error message.

SAM Errors

SAMs have their own error codes. These error codes are in the -100000 range and are very rare. Some, however, are reported by Zim; the most likely ones are as follows:

-100012The control file cannot be found. Ensure the SQLCPI environment variable points to the proper directory.
-100013Ensure the SQLCPI environment variable is pointing to the correct directory.  Ensure the control file (i.e., odbc2m.cpi) contains the appropriate record.
-100023Attempts by Zim to access the SAM have failed. Lack of memory is the likely cause.
-100037Connect has failed. Check the CONNECT parameters.
-100047Incompatible version numbers have been detected. Check that your SQLCPI variable is pointing to the correct directory, as it could accessing an out-of-date SAM.

 

Was this article helpful?
5 out of 5 stars

1 rating

5 Stars 100%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

pt_BRPortuguese