Syntax conventions

The following conventions are used in the SQL syntax descriptions:

  • Keywords   All SQL keywords appear in uppercase, like the SQL statement ALTER TABLE in the following example:

    ALTER TABLE [ owner.]table-name

  • Placeholders   Items that must be replaced with appropriate identifiers or expressions appear in italics, like the words owner and table-name in the following example:

    ALTER TABLE [ owner.]table-name

  • Optional portions   Optional portions of a statement are enclosed by square brackets. For example:

    RELEASE SAVEPOINT [ savepoint-name ]

    These square brackets indicate that the savepoint-name is optional. The square brackets should not be typed.

    You might also see square brackets around a portions of keywords. For example, the following syntax indicates that you can use either COMMIT TRAN or COMMIT TRANSACTION:

    COMMIT TRAN[SACTION] ...

    Likewise, the following syntax indicates that you can use either COMMIT or COMMIT WORK:

    COMMIT [ WORK ]

  • Repeating items   An item that can be repeated is followed by the appropriate list separator and an ellipsis (three dots), like column-constraint in the following example:

    ADD column-definition [ column-constraint, ... ]

    In this case, you can specify no column constraint, one, or more. If more than one is specified, they must be separated by commas.

  • Options   When none or only one of a list of items can be chosen, vertical bars separate the items and the list is enclosed in square brackets.

    [ ASC | DESC ]

    For example, you can choose one of ASC, DESC, or neither. The square brackets should not be typed.

  • Alternatives   When precisely one of the options must be chosen, the alternatives are enclosed in curly braces.

    [ QUOTES { ON | OFF } ]

    In this case, if the QUOTES option is chosen, one of ON or OFF must be provided. The brackets and braces should not be typed.