# COBOL Level 8: Databases

> Level 8: Databases of the LoWisa COBOL course: Embedded SQL, DB2 Concepts, Transactional Data. 3 lessons and 9 ideas, each explained in one line.

Databases is level 8 of 12 of the [LoWisa COBOL course](/courses/cobol/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## Embedded SQL

- **EXEC SQL.** COBOL embeds SQL between **EXEC SQL** and END-EXEC: relational access inside the program.
- **Host variables.** **Host** variables carry values between COBOL and SQL: declared in both worlds, prefixed with colons.
- **SQLCODE.** Every statement sets **SQLCODE**: checked after each call, with +100 as the not-found that is not an error.

## DB2 Concepts

- **Cursors.** A **cursor** walks a result set: DECLARE, OPEN, FETCH in a loop, CLOSE.
- **Precompilation.** Embedded SQL **precompiles**: statements bound into packages the database optimises ahead of time.
- **NULL indicators.** Nullable columns pair with **indicator** variables: absence handled explicitly, or values lie.

## Transactional Data

- **COMMIT and ROLLBACK.** Units of work end with **COMMIT** or ROLLBACK: batch commits batched for restartability.
- **Locking awareness.** Long cursors hold **locks**: commit frequency balancing safety against concurrency.
- **Integrity with files.** Estates mix files and tables: **consistency** across both is the program’s burden, designed.

## Before and after this level

- **Before:** [Level 7: Batch Processing](/courses/cobol/level-7-batch-processing/): Batch Jobs, JCL Interaction Concepts, Large-Scale Transaction Processing.
- **Next:** [Level 9: Online Transactions](/courses/cobol/level-9-online-transactions/): CICS Concepts, Transaction Programs, Enterprise Mainframe Workflows.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does COBOL Level 8: Databases cover?

Embedded SQL, DB2 Concepts, Transactional Data: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 7: Batch Processing, which covers Batch Jobs, JCL Interaction Concepts, Large-Scale Transaction Processing.

## Learn COBOL on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/cobol/level-8-databases/ · Updated 2026-11-25
