skip to main content
OpenAccess SDK SQL Engine core methods for Java : Exchanging data : dam_addError
 

dam_addError

This method adds an error to the error list that is maintained by the OpenAccess SDK SQL engine at the environment, connection, or statement level. The error string is returned to the client. This is the only way to pass the IP-specific error information to the client. An IP method uses dam_addError to return an error by adding an error and returning DAM_FAILURE. Error messages that are added using this function are reported with SQL state HY000. Use dam_addErrorEx to specify the SQL state. Using dam_addError is the recommended approach to report back errors to the client.
void dam_addError(
     long   hdbc,
     long   hstmt,
     int    iErrorIndex,
     int    iNativeError,
     String szErrorText)
Table 120. Parameters for dam_addError
Parameter
Type
Description
INPUT
hdbc
long
The connection handle. Set to 0 if the error is related to a statement and not to the connection.
hstmt
long
The statement handle. Set to 0 if the error is related to a statement and not to the connection.
iErrorIndex
int
Set to DAM_IP_ERROR to indicate an error from the IP.
iNativeError
int
Native error as defined by the IP.
szErrorText
String
The text to use in place of the standard text. Data from this buffer is copied into the error queue. Set to NULL to use the default error string.
RETURN
NONE

See also

*dam_addError
*dam_addErrorEx