DB2 for i CLI functions

These DB2® for i call level interface APIs are available for database access on the IBM® i operating system. Each of the DB2 for i CLI function descriptions is presented in a consistent format.

See Categories of DB2 for i CLIs for a categorical listing of the functions.

How the CLI functions are described

The following table shows the type of information that is described in each section of the function description.

Type Description
Purpose This section gives a brief overview of what the function does. It also indicates if any functions should be called before and after calling the function being described.
Syntax

This section contains the C language prototype for the i5/OS environment.

Arguments This section lists each function argument, along with its data type, a description and whether it is an input or output argument.

Each DB2 for i CLI argument is either an input or output argument. With the exception of SQLGetInfo(), DB2 for i CLI only modifies arguments that are indicated as output.

Some functions contain input or output arguments which are known as deferred or bound arguments. These arguments are pointers to buffers allocated by the application. These arguments are associated with (or bound to) either a parameter in an SQL statement, or a column in a result set. The data areas specified by the function are accessed by DB2 for i CLI at a later time. It is important that these deferred data areas are still valid at the time DB2 for i CLI accesses them.

Usage This section provides information about how to use the function, and any special considerations. Possible error conditions are not discussed here, but are listed in the diagnostics section instead.
Return codes

This section lists all the possible function return codes. When SQL_ERROR or SQL_SUCCESS_WITH_INFO is returned, error information can be obtained by calling SQLError().

Refer to Diagnostics in a DB2 for i CLI application for more information about return codes.

Diagnostics

This section contains a table that lists the SQLSTATEs explicitly returned by DB2 for i CLI (SQLSTATEs generated by the Database Management System (DBMS) might also be returned) and indicates the cause of the error. These values are obtained by calling SQLError() after the function returns SQL_ERROR or SQL_SUCCESS_WITH_INFO.

An * in the first column indicates that the SQLSTATE is returned only by DB2 for i CLI, and is not returned by other ODBC drivers.

Refer to Diagnostics in a DB2 for i CLI application for more information about diagnostics.

Restrictions This section indicates any differences or limitations between DB2 for i CLI and ODBC that might affect an application.
Example This section is a code fragment demonstrating the use of the function. The complete source used for all code fragments is listed in Examples: DB2 for i CLI applications.
References This section lists related DB2 for i CLI functions.