Using Syntax Diagrams and Syntax Tables

Before you try to use the syntax diagrams in this chapter, it is helpful to read the syntax diagram section of the Introduction. This section is the key to understanding the syntax diagrams and explains the elements that can appear in a syntax diagram and the paths that connect the elements to each other. This section also includes an example that illustrates the elements of typical syntax diagrams. The narrative that follows the example diagram shows how to read the diagram in order to enter the statement successfully.

Notes® to the diagram can reference other syntax segments or can specify various restrictions. If you are using an application programming interface, such as ESQL/C, only the SQL syntax rules that both your client application and the database server support are valid.

When a syntax diagram includes input specifications that are not keywords, syntax segments, nor punctuation symbols, such as identifiers, expressions, filenames, or host variables, the syntax diagram is followed by a table that describes how to enter the term without generating errors. Each syntax table includes four columns:
  • The Element column lists each variable term in the syntax diagram.
  • The Description column briefly describes the term and identifies the default value, if the term has one.
  • The Restrictions column summarizes the restrictions on the term, such as acceptable ranges of values. (For some diagrams, restrictions that cannot be tersely summarized appear in the Usage notes, rather than in this column.)
  • The Syntax column points to the SQL segment that gives the detailed syntax for the term. For a few terms, such as the names of host variables, pathnames, or literal characters, no page reference is provided.

The diagrams generally provide an intuitive notation for what is valid in a given SQL statement, but for some statements, dependencies or restrictions among syntax elements are identified only in the text of the Usage section.