Advantages of using Db2 for i CLI instead of embedded SQL

The Db2® for i 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 for i CLI applications do not need to be bound to each database to which they connect.
  • Db2 for i CLI applications can connect to multiple databases simultaneously.
  • Db2 for i CLI applications are not responsible for controlling global data areas, such as the SQL Diagnostics Area and SQL descriptors, as they are with embedded SQL applications. Instead, Db2 for i CLI allocates and controls the necessary data structures, and provides a handle for the application to refer to them.