Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - SQL Reference » SQL statements

Syntax conventions

These are the conventions 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 (also called variable values, or variables)

    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

    When placeholders are multiple words, the words are separated by hyphens (for example, table-name) instead of underscores to differentiate them from parameters.

  • Parameters

    Parameters for objects like functions are set in the software, and when specified, must match the wording used in the software. When parameters are multiple words, the words are separated by underscores. Parameters in syntax documentation are bolded (for example, table_name).

  • Clause order

    If the order of optional clauses is significant in SQL statement syntax, the clauses are already listed in the syntax in the order in which they should be listed. As a best practice, and to aid you in finding specific clause help for a statement, follow the order of clauses prescribed in the documentation.

    TO publication-name
    [ FOR ml-username, ...  ]
  • Optional portions

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

    RELEASE SAVEPOINT [ savepoint-name ]

    These square brackets indicate that specifying a value for 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:


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

  • Denoting the repetition of a part of syntax

    An item that can be repeated is denoted using an ellipsis (three dots) and corresponding bracketing that confirms the optional repetition. Both of the following styles are used in syntax documentation and are semantically equivalent, but one style may be used over the other to aid readability in complicated syntaxes.

    ADD column-definition [ column-constraint, ... ]
    ADD column-definition [ column-constraint [,...] ]
  • Sets of values

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

    { ON | OFF }
    [ ASC | DESC ]

    In the first example, one value is required, and can be either ON or OFF. In the second example, you can specify one of ASC, DESC, or neither. As always, brackets should not be typed unless they are bolded and part of the string you are required to type.

  • 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.

  • Bracketing

    Curly brackets ({ }) indicate a set that you must choose a value from and are almost never typed unless specifically identified as such. Square brackets ([ ]) indicate that the content within the brackets is optional; square brackets are never typed. Round brackets (( )) are part of syntax and must be typed.