The DB2 Universal Database for z/OS Application Programming and SQL Guide provides information about how to use the application programming interfaces (APIs) and the SQL language of DB2 UDB for z/OS.
This IBM book is the Application Programming and SQL Guide for DB2 Universal Database for z/OS, Version 8, product number 5625-DB2 (document SC18-7415-05, sixth edition, February 2008). Part 1 covers using SQL queries: retrieving data with SELECT, creating and dropping tables, views and temporary tables, inserting, updating and deleting rows, joining data from more than one table, using subqueries, and running SQL from a workstation with SPUFI.
Part 2 covers coding SQL in host application programs: the basics of embedding SQL, using cursors to retrieve sets of rows, generating table declarations with DCLGEN, and embedding SQL statements in assembler, C, C++, COBOL, Fortran, PL/I and REXX applications. Later chapters cover check and referential constraints for data integrity and DB2-generated key values such as ROWID columns, identity columns and sequence objects.
| Product version | Version 8 |
|---|---|
| Product number | 5625-DB2 |
| Host languages for embedded SQL | assembler, C, C++, COBOL, Fortran, PL/I, REXX |
| DCLGEN supported languages | C, COBOL, and PL/I |
| Decimal precision | 15-digit and 31-digit |
It applies to Version 8 of IBM DB2 Universal Database for z/OS, product number 5625-DB2.
The book has a chapter on using SPUFI to execute SQL from your workstation, including allocating an input data set and browsing the output.
DCLGEN supports C, COBOL, and PL/I, and the generated data declarations can be included in your program.
By using a cursor: declare the cursor, open it, specify what to do at end-of-data, execute SQL statements, and close it.