********************************************************************** * * README file for CLI Samples * DB2 Universal Database for NUMA-Q * (supporting the PTX Operating System) * * Last update : November, 1999 * * These programming examples are for the C programming language, and * can be found in the "sqllib/samples/cli" directory. Copy these files * to your working directory prior to building the sample programs. * * WARNING: Some of these samples will change your database manager * configuration. Execute the samples in a test instance only. * ********************************************************************** * QUICKSTART * * 1) Copy /sqllib/samples/cli/* to a working directory * 2) Modify the makefile to reflect your environment: * o set UID * o set PWD * o set DB * 3) Excute 'make all' from the working directory * ********************************************************************** * * For more information on programming in CLI see the: * o "Building CLI Applications" section of the Application Building Guide * o CLI Guide and Reference. * o the CLI makefile * * For more information on the SQL language see the SQL Reference. * * For the latest information on programming, compiling, and running DB2 * applications, refer to the DB2 application development website at * http:// www.software.ibm.com/data/db2/udb/ad * ********************************************************************** * * All samples that require a connection will prompt for: * server, user name, password. * Optionally they can be passed on the command line, but many samples * will prompt for other values. * * All objects are created with a qualifier of the current userid. * ********************************************************************** * * File Descriptions: * ********************************************************************** README - this file! makefile - makefile for all files ********************************************************************** *Common Utility Functions * * utilcli.c - Error-checking utility file for CLI programs. * utilcli.h - Header file for utilcli.c * utilapi.c - Error-checking utility file for CLI programs with DB2 APIs. * utilapi.h - Header file for utilapi.c *********************************************************************** *Application Level (programs that deal with the application level of * DB2/CLI). * apinfo.c - How to get and set application level information. aphndls.c - How to allocate and free handles. apsqlca.c - How to work with SQLCA data. ************************************************************************ *Installation Image Level (programs that deal with the installation image * level of DB2 and CLI.) * ilinfo.c - How to get and set installation level information (such as the version of the CLI driver). ************************************************************************* *Instance Level (programs that deal with the instance level of DB2 and CLI). * ininfo.c - How to get and set instance level information. ************************************************************************* *Database Level (programs that deal with database objects in DB2). * dbconn.c - How to connect and disconnect from a database. dbinfo.c - How to get and set information at a database level. dbmconn.c - How to connect and disconnect from multiple databases. dbmuse.c - How to work perform transactions with multiple databases. dbnative.c - How to translate a statement that contains an ODBC escape clause to a data source specific format. dbuse.c - How to work with database objects. dbusemx.sqc - How to use a single database in conjunction with embedded SQL. *************************************************************************** *Table Level (programs that deal with table objects in DB2). * tbconstr.c - How to work with table constraints. tbdefine.c - How to create, alter, and drop tables. tbinfo.c - How to get and set information at a table level. tbmod.c - How to modify information in a table. tbread.c - How to read information in a table. *************************************************************************** *Data Type Level (programs that deal with data types). * dtinfo.c - How to get information about data types dtlob.c - How to read and write LOB data. dtudt.c - How to create, use, and drop user defined distinct types. *************************************************************************** *UDF Level (programs that demonstrate user defined functions). * udfcli.c - Client application which calls the user defined function in udfsrv.c udfsrv.c - User defined function ScalarUDF called by udfcli.c sample. *************************************************************************** *Stored Procedure Level - Samples that demonstrate stored procedures in CLI. * spcreate.db2 - CLP script to issue CREATE PROCEDURE statements. spdrop.db2 - CLP script to drop stored procedures from the catalog. spclient.c - Client application that calls all of the stored procedures. spserver.c - Stored procedure functions built and run on the server. To build the spserver shared library: 1. To allow unloading shared libraries while developing stored procedures, enter: "db2 update dbm cfg using KEEPDARI no". 2. Enter either "bldsrv spserver" or "make spserver". 3. Enter: "db2 connect to sample". 4. If the stored procedures were previously cataloged for a different language, uncatalog them by entering: "db2 -td@ -vf spdrop.db2". 5. Catalog the stored procedures by entering: "db2 -td@ -vf spcreate.db2". *************************************************************************** *Build Files * bldapi - Builds a CLI program that uses DB2 APIs. bldcli - Builds a CLI program bldclisp - Builds a CLI stored procedure. embprep - Precompiles and binds embedded SQL programs. *************************************************************************** *Configuration Files * cli.icc - Used for DB2 CLI applications for VisualAge C++ Version 4.0 clis.icc - Used for DB2 CLI stored procedures for VisualAge C++ Version 4.0 ****************************************************************************