Powered by Zoomin Software. For more details please contactZoomin

DataDirect OpenAccess SDK Help

dam_addError

  • Last Updated: May 12, 2026
  • 1 minute read
    • OpenAccess SDK
    • Version 8.1
    • Documentation

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)

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

TitleResults for “How to create a CRG?”Also Available inAlert