skip to main content
OpenAccess SDK SQL Engine Core Functions API : Function Reference : dam_addErrorEx/dam_addErrorExW
 

dam_addErrorEx/dam_addErrorExW

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)
Table 55. 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

*dam_addError/dam_addErrorW