This topic defines the DB2® for
SQL language elements for DB2 for IBM® i.
About SQL reference
This book defines Structured Query Language (SQL) as supported
by DB2 for IBM i. It
contains reference information for the tasks of system administration,
database administration, application programming, and operation. This
manual includes syntax, usage notes, keywords, and examples for each
of the SQL statements used on the system.
What's new for IBM i 7.1
This topic highlights the changes made to this topic collection
for IBM i 7.1.
Concepts
This chapter provides a high-level view of concepts that are important
to understand when using Structured Query Language (SQL). The reference material
contained in the rest of this manual provides a more detailed view.
Language elements
This section defines the basic syntax of SQL and language elements
that are common to many SQL statements.
Built-in functions
This chapter contains syntax diagrams, semantic descriptions,
rules, and examples of the use of the built-in functions listed
in the following tables.
Queries
A query specifies a result table or an intermediate result
table. A query is a component of certain SQL statements.
Statements
This section contains syntax diagrams, semantic descriptions,
rules, and examples of the use of the SQL statements.
SQL control statements
Control statements are SQL statements that allow SQL to
be used in a manner similar to writing a program in a structured programming
language. SQL control statements provide the capability to control
the logic flow, declare and set variables, and handle warnings and
exceptions. Some SQL control statements include other nested SQL statements.
SQL limits
The following tables describe certain SQL and database
limits imposed by the DB2 for
i database
manager.
Characteristics of SQL statements
This appendix contains information on
the characteristics of SQL statements pertaining to the various places where
they are used.
SQLCA (SQL communication area)
An SQLCA is a set of variables that may be updated at the
end of the execution of every SQL statement. A program that contains
executable SQL statements may provide one, but no more than one SQLCA
(unless a stand-alone SQLCODE or a stand-alone SQLSTATE variable is
used instead), except in Java™,
where the SQLCA is not applicable.
SQLDA (SQL descriptor area)
An SQLDA is a set of variables that is used for execution
of the SQL DESCRIBE statement, and it may optionally be used by the
PREPARE, OPEN, CALL, FETCH, and EXECUTE statements.
CCSID values
The tables in this section describe the CCSIDs and conversions
provided by the IBM relational
database products.
DB2 for i catalog views
The views contained in a DB2 for
i catalog are described
in this section.
Text search argument syntax
A text search argument is specified when searching for
terms in text documents. It consists of search parameters and one
or more search terms. The SQL scalar text search functions that use
text search arguments are CONTAINS and SCORE.
Terminology differences
Some terminology used in the ANSI and ISO standards differs
from the terminology used in this book and other product books.
Reserved schema names and reserved words
This topic describes the restrictions of certain names used by
the database manager. In some cases, names are reserved and cannot be used
by application programs. In other cases, certain names are not recommended
for use by application programs though not prevented by the database manager.
Related information
The publications listed here provide additional information
about topics described or referred to in this guide.