Command Line Demonstrations of COBOL used with SQL

The demonstration programs are installed in subfolders under $COBDIR/demo/sql by default.

db2
Demonstrates the following:
  • Syntax variants supported by IBM DB2 LUW for connecting to and disconnecting from a DB2 database using TYPE 1 CONNECTs.
  • Using SELECT...INTO and cursor-based data retrieval (DECLARE, OPEN, FETCH, CLOSE).
  • Using dynamic SQL to CREATE a table and insert and update data to it.
  • Using LOB LOCATOR and VALUES function to retrieve data from a LOB and copy it to a host variable.
openesql
Demonstrates the following:
  • Using the ODBC catalog functions from COBOL.
  • Using dynamic SQL functions from COBOL
  • Using INSERT, UPDATE, DELETE, SELECT INTO and SELECT using a cursor, plus COMMIT and ROLLBACK.
  • Using different formats of the CONNECT and DISCONNECT statements