Find out how you code your applications to use the DB2® CLI functions.
A DB2 UDB CLI application consists of a set of tasks, each comprised of a set of discrete steps. Other tasks might occur throughout the application as it runs. The application calls one or more DB2 UDB CLI functions to carry out each of these tasks.
Every DB2 UDB CLI application contains the three main tasks that are shown in the following figure. If the functions are not called in the sequence that is shown in the figure, an error results.
The initialization task allocates and initializes resources in preparation for the main Transaction Processing task.
The transaction processing task, the main task of the application, passes queries and modifications to the SQL to DB2 UDB CLI.
The termination task frees allocated resources. The resources generally consist of data areas that are identified by unique handles. After freeing the resources, other tasks can use these handles.
In addition to the three central tasks that control a DB2 UDB CLI application, there are numerous general tasks, such as diagnostic message handlers, throughout an application.
See Categories of DB2 UDB CLIs for an overview of how the CLI functions fit into these key task areas.
This topic provides examples to illustrate how these functions are used in a DB2 UDB CLI application.