ttUtilGetError
Description
Retrieves the errors and warnings generated by the last call to the TimesTen C utility library functions excluding ttUtilAllocEnv
and ttUtilFreeEnv
.
Required Privilege
None
Syntax
ttUtilGetError (ttUtilHandle handle, unsigned int errIndex,
unsigned int* retCode, ttUtilErrType* retType,
char* errbuff, unsigned int buffLen,
unsigned int* errLen)
Parameters
Parameter | Type | Description |
---|---|---|
|
|
Specifies the TimesTen utility library environment handle allocated using |
|
|
Indicates error or warning record to be retrieved from the TimesTen utility library error array. Valid values are as follows:
|
|
|
Returns the TimesTen-specific error or warning codes as defined in |
|
|
Indicates whether the returned message is an error or warning. The following are valid return values:
|
|
|
This is a user allocated buffer where error messages (if any) are to be returned. The returned error message is a null-terminated string. If the length of the error message exceeds |
|
|
Specifies the size of the buffer |
|
|
A pointer to an unsigned integer where the actual length of the error message is returned. If it is |
Return Codes
This utility returns the following codes as defined in ttutillib.h
.
Code | Description |
---|---|
|
Returned upon success. |
|
Returned if an invalid utility library handle is specified. |
|
Returned if no error or warming information is retrieved. |
Example
This example retrieves all error or warning information after calling ttDestroyDataStore
for the DSN named payroll
.
char errBuff[256];
int rc;
unsigned int retCode;
ttUtilErrType retType;
ttUtilHandle utilHandle;
rc = ttDestroyDataStore (utilHandle, "DSN=PAYROLL", 30);
if ((rc == TTUTIL_SUCCESS)
printf ("Datastore payroll successfully destroyed.\n");
else if (rc == TTUTIL_INVALID_HANDLE)
printf ("TimesTen utility library handle is invalid.\n");
else
while ((rc = ttUtilGetError (utilHandle, 0,
&retCode, &retType, errBuff, sizeof (errBuff),
NULL)) != TTUTIL_NODATA)
{
...
...
}
Notes
Each of the TimesTen C functions can potentially generate multiple errors and warnings for a single call from an application. To retrieve all of these errors and warnings, the application must make repeated calls to ttUtilGetError
until it returns TTUTIL_NODATA
.