and CLI functions, as well as the values of variables.•
text is used to draw attention to new terms andconcepts.•
text is used to identify SQL statement and DB2 command options.• Throughout this tutorial, code segments that are irrelevant to thediscussion have been omitted and replaced with ellipses (
Notices and trademarks
Copyright, 2004 International Business Machines Corporation. All rights reserved.IBM, DB2, DB2 Universal Database, DB2 Information Integrator, WebSphere andWebSphere MQ are trademarks or registered trademarks of IBM Corporation in theUnited States, other countries, or both.Other company, product, and service names may be trademarks or service marks ofothers.
Section 2. Introduction to CLI/ODBC programming
What is CLI/ODBC?
One of the biggest drawbacks to developing applications with embedded SQL is thelack of interoperability that such an application affords: Embedded SQL applicationsdeveloped specifically for DB2 UDB will have to be modified (and in some casescompletely rewritten) before they can interact with other relational databasemanagement systems (RDBMSs). Because this limitation exists in every embeddedSQL application, regardless of the RDBMS for which it is written, in the early 1990sthe X/Open Company and the SQL Access Group (SAG), now a part of X/Open, jointly developed a standard specification for a callable SQL interface. This interfacewas known as the
X/Open Call-Level Interface,
Much of the X/OpenCLI specification was later accepted as part of the ISO CLI international standard.The primary purpose of X/Open CLI was to increase the portability of databaseapplications by allowing them to become independent of any one databasemanagement system's programming interface.In 1992, Microsoft developed a callable SQL interface known as
Open Database Connectivity
) for the Microsoft Windows operating system. ODBC isbased on the X/Open CLI standards specification but it provides extendedfunctionality and capability that is not part of X/Open CLI. ODBC relies on anoperating environment in which data source-specific ODBC drivers are dynamicallyloaded at application run time (based on information provided when a connection is