This course describes how to create a COBOL SQL application.
The course begins by describing the coding requirements for embedding SQL statements in a COBOL program. This includes a discussion on how to detect and handle errors that occur during the processing of an SQL statement. The course then describes the CL commands used to compile a COBOL program which includes embedded SQL statements.
Next, the course describes how to use an SQL cursor to access the records returned by a query and how to develop an application that executes SQL statements dynamically. This is followed by a description of the SQL statements used to support commitment control.
The course ends with a discussion of SQL application performance and optimization.
Approximate Study Time: 3 hours
After completing this course, you should be able to:
- Code a COBOL program with embedded SQL statements
- Code the SQL statement to generate a communications area in a program
- Code the SQL statements to define a declare section in your program
- Detect and handle errors that occur during the processing of an SQL statement
- Use the SQLCBLLE and SQLCBL commands to compile a program with embedded SQL statements
- Use Program Development Manager (PDM) to compile a program with embedded SQL statements
- Code the SQL statements used to define and manipulate an SQL cursor
- Code a COBOL program that executes a dynamic SQL statement
- Use SQL statements to perform commit and rollback operations
- Optimize an SQL application
Embedding SQL Statements in a COBOL Program
Compiling a Program with Embedded SQL Statements
Using an SQL Cursor to Process Multiple Rows
Developing a Dynamic SQL Application
SQL and Commitment Control
Performance and Optimization Considerations
This course is intended for COBOL programmers who will be developing SQL applications.
This course assumes that you have a basic knowledge of SQL and can code SQL statements. You can satisfy this prerequisite by successfully completing the first course in this series, SQL Fundamentals. The course also assumes that you are an experienced COBOL programmer. If you are not familiar with both OPM and ILE program development procedures, it is recommended that you take The IBM i Programming Environment series.