The examples of queries that are shown in this book are based on the sample
tables in Appendix A, "DB2 UDB for AS/400 Sample Tables," in the
SQL Programming Concepts
book. For the SQL examples, assume the following:
- They are shown in the interactive SQL environment or they are written in
ILE C or in COBOL. EXEC SQL and END-EXEC are used to delimit an SQL
statement in a COBOL program. A description of how to use SQL
statements in a COBOL program is provided in "
Coding SQL Statements in COBOL Applications
" of the
SQL Programming with Host Languages
book. A description of how to use SQL statements in an ILE C program
is provided in "
Coding SQL Statements in C Applications
" of the
SQL Programming with Host Languages
book.
- Each SQL example is shown on several lines, with each clause of the
statement on a separate line.
- SQL keywords are highlighted.
- Table names provided in Appendix A, "DB2 UDB for AS/400 Sample Tables" of
the
SQL Programming Concepts
use the collection CORPDATA. Table names that are not found in
Appendix A, "DB2 UDB for AS/400 Sample Tables," should use collections you
create.
- Calculated columns are enclosed in parentheses, (), and brackets,
[].
- The SQL naming convention is used.
- The APOST and APOSTSQL precompiler options are assumed although they are
not the default options in COBOL. Character string constants within SQL
and host language statements are delimited by apostrophes (').
- A sort sequence of *HEX is used, unless otherwise noted.
- The complete syntax of the SQL statement is usually not shown in any one
example. For the complete description and syntax of any of the
statements described in this guide, see the
SQL Reference
.
Whenever the examples vary from these assumptions, it is stated.
Because this guide is for the application programmer, most of the examples
are shown as if they were written in an application program. However,
many examples can be slightly changed and run interactively by using
interactive SQL. The syntax of an SQL statement, when using interactive
SQL, differs slightly from the format of the same statement when it is
embedded in a program.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]