Hitachi

Hitachi Advanced Database SQL Reference


2.2 How to read the SQL syntax specification format

This section describes the SQL statement syntax specification format using BNF notation. To explain how to read the SQL statement syntax specification format, the LIKE predicate is used as an example.

Description of the specification format of the LIKE predicate

LIKE-predicate ::= match-value [NOT] LIKE pattern-character-string [ESCAPE escape-character]  ...1
 
  match-value ::= value expression  ...2
  pattern-character-string ::= value expression  ...2
  escape-character ::= value expression  ...2

This notation means that the item on the left of the ::= is described in the format shown on the right of it. Therefore, the meanings of the specifications indicated by 1 and 2 in the preceding format are as follows:

  1. The LIKE predicate takes the form match-value [NOT] LIKE pattern-character-string [ESCAPE escape-character]

  2. match-value, pattern-character-string, and escape-character take the form of value expressions.

In other words, a LIKE predicate is written in the following format:

value-expression [NOT] LIKE value-expression ESCAPE value-expression

Value expressions are described in 7.20 Value expression. Refer to that section for the specification format of a value expression.