Writing a DB2 UDB CLI application
A DB2® UDB CLI application consists of a set of tasks; each task consists of a set of discrete steps. Other tasks might occur throughout the application when 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. Figure 1. Conceptual view of a DB2 UDB CLI application
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.
- Initialization and termination tasks in a DB2 UDB CLI application
The initialization task allocates and initializes environment handles and connection handles.
- Transaction processing task in a DB2 UDB CLI application
The figure shows the typical order of function calls in a DB2 UDB call level interface (CLI) application. The figure does not show all functions or possible paths.
- Diagnostics in a DB2 UDB CLI application
There are two levels of diagnostics for DB2 UDB call level interface (CLI) functions.
- Data types and data conversion in DB2 UDB CLI functions
The table shows all of the supported SQL types and their corresponding symbolic names. The symbolic names are used in SQLBindParam(), SQLBindParameter(), SQLSetParam(), SQLBindCol(), and SQLGetData() to indicate the data types of the arguments.
- Working with string arguments in DB2 UDB CLI functions
These conventions can help you handle various aspects of string arguments in DB2 UDB call level interface (CLI) functions.
Parent topic:
SQL call level interface
Related concepts
DB2 UDB CLI functions