Deciding between DB2 UDB CLI, dynamic SQL, and static SQL

 

Which interfaces you choose depends on your application.

DB2® UDB call level interface (CLI) is ideally suited for query-based applications that require portability but not require the APIs or utilities offered by a particular Database Management System (DBMS) (for example, catalog database, backup, restore). This does not mean that using DB2 UDB CLI calls DBMS-specific APIs from an application. It means that the application is no longer portable.

Another important consideration is the performance comparison between dynamic and static SQL. Dynamic SQL is prepared at run time, while static SQL is prepared at the precompile stage. Because preparing statements requires additional processing time, static SQL might be more efficient. If you choose static over dynamic SQL, then DB2 UDB CLI is not an option.

In most cases the choice between either interface is open to personal preference. Your previous experience might make one alternative seem more intuitive than the other.

 

Parent topic:

Getting started with DB2 UDB CLI