OpenAPI User Guide > OpenAPI User Guide > OpenAPI Function Reference > OpenAPI Functions > IIapi_getErrorInfo() Function--Return Additional Error or User-defined Information
Was this helpful?
IIapi_getErrorInfo() Function--Return Additional Error or User-defined Information
The IIapi_getErrorInfo() function returns a set of error parameters or user-defined information specified by an error handle. User-defined information consists of messages declared in a database procedure. These messages are returned during the execution of the database procedure.
Because the error handle can contain more than one set of error parameters, the application should repeat IIapi_getErrorInfo() until the status IIAPI_ST_NO_DATA is returned by the ge_status parameter.
The output of IIapi_getErrorInfo() is valid until another operation is invoked with the same handle.
This function has the following syntax:
II_VOID IIapi_getErrorInfo (IIAPI_GETEINFOPARM *getEInfoParm);
typedef struct _IIAPI_GETEINFOPARM
{
      II_PTR             ge_errorHandle;
      II_LONG            ge_type;
      II_CHAR            ge_SQLSTATE[6];
      II_LONG            ge_errorCode;
      II_CHAR            *ge_message;
      II_BOOL            ge_serverInfoAvail;
      IIAPI_SVR_ERRINFO  *ge_serverInfo;
      IIAPI_STATUS       ge_status;
} IIAPI_GETEINFOPARM;
This function has the following parameters:
ge_errorHandle
Type: input
Indicates the error handle returned in the generic parameters.
ge_type
Type: immediate output
Indicates the type of message. Its value is one of the following:
API_GE_ERROR
API_GE_WARNING
API_GE_MESSAGE
API_GE_XAERR
ge_SQLSTATE
Type: immediate output
Indicates the SQLSTATE value of the error.
ge_errorCode
Type: immediate output
Indicates the error code generated by the server.
When ge_type is API_GE_XAERR, the error code will be an XA standard error code (see XA Error Codes on page 10).
ge_message
Type: immediate output
Provides the text of the message.
The OpenAPI manages the memory for this parameter. For more information, see Output Parameters Allocated by OpenAPI).
ge_serverInfoAvail
Type: immediate output
Indicates whether additional information will be made available. TRUE if the server sent the message; FALSE if the message was generated by OpenAPI. If TRUE, additional information is available in ge_serverInfo.
ge_serverInfo
Type: immediate output
Specifies additional information sent by the server. Only available if ge_serverInfoAvail is TRUE.
ge_status
Type: immediate output
Indicates the status of the function upon its return. Its value is one of the following:
IIAPI_ST_SUCCESS
IIAPI_ST_NO_DATA
IIAPI_ST_NOT_INITIALIZED
IIAPI_ST_INVALID_HANDLE
Last modified date: 11/28/2023