Syntax Diagram Conventions - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
15.00
Language
English (United States)
Last Update
2018-09-28
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database

Syntax Diagram Conventions

Notation Conventions

 

Item

Definition / Comments

Letter

An uppercase or lowercase alphabetic character ranging from A through Z.

Number

A digit ranging from 0 through 9.

Do not use commas when typing a number with more than 3 digits.

Word

Keywords and variables.

  • UPPERCASE LETTERS represent a keyword.
  • Syntax diagrams show all keywords for SQL statements in uppercase, unless operating system restrictions require them to be in lowercase.

  • lowercase letters represent a keyword that you must type in lowercase, such as a Linux command.
  • Mixed Case letters can be used to represent functions, methods, and other non-SQL keywords that can be entered in uppercase, lowercase or mixed case.
  • lowercase italic letters represent a variable such as a column or table name.
  • Substitute the variable with a proper value.

  • lowercase bold letters represent an excerpt from the diagram. The excerpt is defined immediately following the diagram that contains it.
  • UNDERLINED LETTERS represent the default value.
  • This applies to both uppercase and lowercase words.

    Spaces

    Use one space between items such as keywords or variables.

    Punctuation

    Type all punctuation exactly as it appears in the diagram.

    Paths

    The main path along the syntax diagram begins at the left with a keyword, and proceeds, left to right, to the vertical bar, which marks the end of the diagram. Paths that do not have an arrow or a vertical bar only show portions of the syntax.

    The only part of a path that reads from right to left is a loop.

    Continuation Links

    Paths that are too long for one line use continuation links. Continuation links are circled letters indicating the beginning and end of a link:

    When you see a circled letter in a syntax diagram, go to the corresponding circled letter and continue reading.

    Required Entries

    Required entries appear on the main path:

    If you can choose from more than one entry, the choices appear vertically, in a stack. The first entry appears on the main path:

    Optional Entries

    You may choose to include or disregard optional entries. Optional entries appear below the main path:

    If you can optionally choose from more than one entry, all the choices appear below the main path:

    Some commands and statements treat one of the optional choices as a default value. This value is UNDERLINED. It is presumed to be selected if you type the command or statement without specifying one of the options.

    Strings

    String literals appear in apostrophes:

    Abbreviations

    If a keyword or a reserved word has a valid abbreviation, the unabbreviated form always appears on the main path. The shortest valid abbreviation appears beneath.

    In the above syntax, the following formats are valid:

  • SHOW CONTROLS
  • SHOW CONTROL
  • Loops

    A loop is an entry or a group of entries that you can repeat one or more times. Syntax diagrams show loops as a return path above the main path, over the item or items that you can repeat:

    Read loops from right to left.

    The following conventions apply to loops:

     

    IF...

    THEN...

    there is a maximum number of entries allowed

    the number appears in a circle on the return path.

    In the example, you may type cname a maximum of 4 times.

    there is a minimum number of entries required

    the number appears in a square on the return path.

    In the example, you must type at least three groups of column names.

    a separator character is required between entries

    the character appears on the return path.

    If the diagram does not show a separator character, use one blank space.

    In the example, the separator character is a comma.

    a delimiter character is required around entries

    the beginning and end characters appear outside the return path.

    Generally, a space is not needed between delimiter characters and entries.

    In the example, the delimiter characters are the left and right parentheses.

    Excerpts

    Sometimes a piece of a syntax phrase is too large to fit into the diagram. Such a phrase is indicated by a break in the path, marked by (|) terminators on each side of the break. The name for the excerpted piece appears between the terminators in boldface type.

    The boldface excerpt name and the excerpted phrase appears immediately after the main diagram. The excerpted phrase starts and ends with a plain horizontal line:

    Multiple Legitimate Phrases

    In a syntax diagram, it is possible for any number of phrases to be legitimate:

    In this example, any of the following phrases are legitimate:

  • dbname
  • DATABASE dbname
  • tname
  • TABLE tname
  • vname
  • VIEW vname
  • Sample Syntax Diagram

    Diagram Identifier

    The alphanumeric string that appears in the lower right corner of every diagram is an internal identifier used to catalog the diagram. The text never refers to this string.