This function returns the diagnostic information associated with the most recently called function.
Syntax :
RETCODE SQLError( henv, hdbc,hstmt sqlState, nativeErr, errMsg, errMsgMax, pcbErrMsg);
Arguments :
The arguments for SQLError are listed in below table.
| Type | Name | Description |
| SQLHENV | henv | Environment handle. To obtain diagnostic information associated with an environment |
| SQLHDBC | hdbc | Database connection handle. To obtain diagnostic information associated with a connection |
| SQLHSTMT | hstmt | Statement handle. To obtain diagnostic information associated with a statement, pass a valid statement handle. The henv and hdbc arguments are ignored. |
| SQLCHAR* | sqlState | SQLSTATE as a string of 5 characters terminated by a null character. The first 2 characters indicate error class; the next 3 indicate subclass. |
| SQLINTEGER* | nativeErr | Native error code |
| SQLCHAR* | errMsg | Pointer to buffer to contain the implementation defined message text. |
| SQLSMALLINT | errMsgMax | Maximum (that is, the allocated) length of the buffer errMsg |
| SQLSMALLINT* | pcbErrMsg | Pointer to total number of bytes available to return to the errMsg buffer. |