****************************************************************************** * (c) Copyright IBM Corp. 2007 All rights reserved. * * The following sample of source code ("Sample") is owned by International * Business Machines Corporation or one of its subsidiaries ("IBM") and is * copyrighted and licensed, not sold. You may use, copy, modify, and * distribute the Sample in any form without payment to IBM, for the purpose of * assisting you in the development of your applications. * * The Sample code is provided to you on an "AS IS" basis, without warranty of * any kind. IBM HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR * IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Some jurisdictions do * not allow for the exclusion or limitation of implied warranties, so the above * limitations or exclusions may not apply to you. IBM shall not be liable for * any damages you suffer as a result of using, copying, modifying or * distributing the Sample, even if IBM has been advised of the possibility of * such damages. * ****************************************************************************** * * README for Command Line Processor Samples * * The <install_path>/sqllib/samples/clp directory contains this README file * where <install_path> is the location of DB2 9.7 on your hard drive. * The default location for <install_path> is $HOME on Unix and * C:\Program Files\IBM on windows. * * This README describes how to run CLP sample code for DB2 9.7. The DB2 9.7 * sample code for CLP is located in the following directory: * * <install_path>/sqllib/samples/clp * * Copy the sample files from this directory to a working directory prior to * executing the sample programs. The sample program directories are typically * read-only on most platforms and some samples produce output files that * require write permissions on the directory. * * WARNING: Some of these samples may change your database or database manager * configuration. Execute the samples against a test database * only, such as the DB2 SAMPLE database. * ****************************************************************************** * * Prepare your DB2 sample development environment * * 1) Copy the files in <install_path>/sqllib/samples/clp/* to a working * directory and ensure that directory has write permission. * * On windows platform, all samples should be run and built in a DB2 * Command Window. The DB2 Command Window is needed to execute db2 * specific commands. You can follow the step below to open * DB2 Command window. * From the Start Menu click Start --> Programs --> IBM DB2 --> * <DB2 copy name> --> Command Line Tools --> Command Window. * * 2) Start the Database Manager with the following command: * db2start * * 3) Create the sample database with the following command: * db2sampl * * 4) Connect to the database with the following command: * db2 connect to sample * * 5) cd to the directory containing the files copied in Step 1. * ****************************************************************************** * * *** Executing CLP Samples *** * * Use following command to execute CLP samples: * db2 -vf <filename> -t * <filename> -- Name of the Command Line Processor file (including * the extension). * ****************************************************************************** * * Common file Descriptions * * The following are the common files for Command Line Processor samples. * For moreinformation on these files, refer to the program source files. * ****************************************************************************** * * Common files * * README - this file * ****************************************************************************** * * Command Line Processor Sample Descriptions * * The following are the Command Line Processor sample files included with DB2. * For more information on the sample programs, refer to the program source * files. * ****************************************************************************** * * COMMAND LINE PROCESSOR Samples * * const.db2 - How to create a table with a check constraint * cte.db2 - How to create a COMMON TABLE EXPRESSION * flt.db2 - How to do a RECURSIVE QUERY * join.db2 - How to OUTER JOIN tables * implicitcasting.db2 - To demonstrate use of Implicit casting. * stock.db2 - How to use triggers * scalarfunction.db2 - How to use the scalar functions and the special register * tablestatesize.db2 - How to use SYSPROC.ADMIN_GET_TAB_INFO and * SYSIBMADM.ADMINTABINFO views to obtain the size and * other status information for a table * tbast.db2 - How to use staging table for updating deferred AST * tbcompress.db2 - How to create tables with null and default value * compression option * tbconstr.db2 - How to create, use, and drop constraints * tbread.db2 - How to read tables * tbtemp.db2 - How to use a declared temporary table * tbumqt.db2 - How to use user materialized query * tables (summary tables) * testdata.db2 - How to populate a table with randomly generated * test data * datecompat.db2 - To demonstrate date compatibility features ******************************************************************************