17.10 - DBCHFERL - Call-Level Interface Version 2

Teradata® Call-Level Interface Version 2 Reference for Workstation-Attached Systems

Call-Level Interface Version 2
Release Number
October 2021
Last Update
Content Type
Programming Reference
Publication ID
English (United States)

DBCHFERL (Fetch Error Localized) is an extension of DBCHFER. This routine has an additional capability of returning the session-specific error information in localized form. Messages are returned by CLI, in the message buffer provided by the application, in the specified language. The length of the message returned depends on the size of the buffer allocated. The value returned by this routine is the value that was returned by the CLI service routine that encountered the error being reported.


  • (int LogSessId,
  • register errpt_t Err,
  • char*msgbuf,
  • unsigned short ibuflen,
  • unsigned short * obuflen,
  • short * msgerr)

Integer logical session number assigned by CLI, if error information for a specific session is desired.

If this value is zero, information on the last error that occurred overall is provided. The size of this argument is the integer size on the target machine.


pointer to a structure to receive error codes. This structure is defined in COPERR.H, and has the following format:

struct err_code{
int e_class;
int e_reason;
long e_syst;

This argument is optional and should be NULL if no specific error code information is desired.

msgbuf pointer to a buffer for placing error message. Allocated by the application.
ibuflen size of the message buffer allocated by the application
obuflen length of the message returned by CLI, in application-provided buffer
msgerr Indicating error, if one occurred while building the message.
  • -1 = Application failed to provide a valid buffer
  • 1 = Error message is truncated
  • 0 = Successfully build the message