Previous Topic Next topic Print topic


Demonstration Applications

A number of DB2 ECM demonstration applications are supplied in the Samples Browser, available from Start > All Programs > Micro Focus Visual COBOL > Samples . These files are located in the %PUBLIC%\Documents\Micro Focus\Visual COBOL\Samples\sql\db2ecm (Windows) or $COBDIR/demo/sql/db2 (UNIX) directory.

Each sample application comes with a Readme file to explain how to use the application, and a makefile.

The following applications are provided:

For Windows environments

  • Connect Demo

    Shows the syntax variants for connecting to and disconnecting from a DB2 database using Type 1 CONNECTs that IBM DB2 LUW supports.

  • Dynamic Demo

    A simple example of using dynamic SQL with IBM DB2 LUW, performing a variety of SQL operations. If this program was written as a STATIC SQL program, it would have to be broken apart into two programs, since static SQL requires that the table exists beforehand or it would cause a Compiler error.

  • Lob Demo

    Shows how LOB LOCATOR and VALUES functions to retrieve Lob data from DB2 LUW.

  • Select Demo

    A simple example of using both singleton SELECT and cursor-based FETCH statements with IBM DB2 LUW.

  • Whenever Demo

    Shows how to use EXEC SQL WHENEVER statements for error handling, and the DB2(MSGAREA) Compiler directive to specify a COBOL variable for retrieving error message text larger than the 70 bytes provided in SQLERRMC.

For UNIX environments

  • db2test1.cbl

    Shows the syntax variants for connecting to and disconnecting from a DB2 database using Type 1 CONNECTs that IBM DB2 LUW supports.

  • db2test2.cbl

    A simple example of using both singleton SELECT and cursor-based FETCH statements with IBM DB2 LUW.

  • dynamic.cbl

    A simple example of using dynamic SQL with IBM DB2 LUW, performing a variety of SQL operations. If this program was written as a STATIC SQL program, it would have to be broken apart into two programs, since static SQL requires that the table exists beforehand or it would cause a Compiler error.

  • lobdemo.cbl

    Shows how LOB LOCATOR and VALUES functions to retrieve Lob data from DB2 LUW.

  • whenever.cbl

    Shows how to use EXEC SQL WHENEVER statements for error handling, and the DB2(MSGAREA) Compiler directive to specify a COBOL variable for retrieving error message text larger than the 70 bytes provided in SQLERRMC.

Previous Topic Next topic Print topic