Powered by Zoomin Software. For more details please contactZoomin

DataDirect OpenAccess SDK Help

dam_addErrorEx/dam_addErrorExW

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

This function adds an error to the error list maintained by the OpenAccess SDK SQL engine. An error is added at the environment, connection, or statement level. This error string is returned to the client. This is the only way to pass an IP-specific error message to the client. An IP function returns an error by adding an error using this function and then returning DAM_FAILURE.

Use the dam_addError/dam_addErrorW function if you do not want to specify a SQL state and instead want to use the default SQL state.

void dam_addErrorEx(
    DAM_HDBC   hdbc, 
    DAM_HSTMT  hstmt, 
    char *     szSqlState,
    int        iNativeError,
    char *     szErrorText)
void dam_addErrorExW(
    DAM_HDBC   hdbc,
    DAM_HSTMT  hstmt,
    OAWCHAR *  szSqlState,
    int        iNativeError,
    OAWCHAR *  szErrorText)

Parameters for dam_addErrorEx/dam_addErrorExW

Parameter Type Description
IN
hdbc DAM_HDBC The connection handle. Set to NULL if the error is related to a statement and not to the connection.
hstmt DAM_HSTMT The statement handle. Set to NULL if the error is related to a connection.
sSqlState char * Five-character string representing the SQL state portion of the error.
iNativeError int Native error as defined by the IP.
szErrorText char *
OAWCHAR *
Message text. Data from this buffer is copied into the error queue.
RETURN
NONE

See also

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