Advantages of using DB2 UDB CLI instead of embedded SQL
The DB2® UDB call level interface (CLI) has several key advantages over embedded SQL.
- It is ideally suited for a client-server environment, in which the target database is not known when the application is built. It provides a consistent interface for executing SQL statements, regardless of which database server to which the application is connected.
- It increases the portability of applications by removing the dependence on precompilers. Applications are distributed not as compiled applications or runtime libraries but as source code that is preprocessed for each database product.
- DB2 UDB CLI applications do not need to be bound to each database to which they connect.
- DB2 UDB CLI applications can connect to multiple databases simultaneously.
- DB2 UDB CLI applications are not responsible for controlling global data areas, such as SQL communication area (SQLCA) and SQL descriptor area (SQLDA), as they are with embedded SQL applications. Instead, DB2 UDB CLI allocates and controls the necessary data structures, and provides a handle for the application to refer to them.
Parent topic:
Getting started with DB2 UDB CLI