Expressions

Note   The syntax of <value_expression> is generally the same as SQL-92, subclause 6.11, <value_expression>. Differences are:

 
<value_expression> ::= <numeric_value_expression> 
                     | <string_value_expression> 

<numeric_value_expression> ::= <term> 
                   | <numeric_value_expression> {<plus> | <minus>} <term>

<term> ::= <factor> | <term> {<asterisk> | <solidus>} <factor>

<factor> ::= [<sign>] <numeric_primary>

<sign> ::= + | -

<plus> ::= +

<minus> ::= -

<asterisk>::= *

<solidus> ::= /

<numeric_primary> ::= <value_expression_primary> 
                    | <numeric_value_function>

Note   The data type of <value_expression_primary> in the above production shall be numeric.

 
<value_expression_primary> ::= <unsigned_numeric_literal>
                            | (<value_expression>)
                            |  <character_string_literal>
                            | [<cube_name>.]<tuple>[.VALUE]
                            |  <property>[.VALUE]
                            |  <conditional_expression>

<conditional_expression> ::= <if_expression> | <case_expression>

<if_expression> ::= iif(<search_condition>, <true_part>, <false_part>)

<true_part> ::= <value_expression>

<false_part> ::= <value_expression>

<case_expression> ::= <simple_case> | <searched_case> | <coalesce_empty>

<simple_case> ::= CASE <case_operand>
                     <simple_when_clause>...
                    [<else_clause>]
                  END

<searched_case> ::= CASE
                       <searched_when_clause>...
                      [<else_clause>]
                    END

<simple_when_clause> ::= WHEN <when_operand> THEN <result>

<searched_when_clause> ::= WHEN <search_condition> THEN <result>

<else_clause> ::= ELSE <value_expression>

<case_operand> ::= <value_expression>

<when_operand> ::= <value_expression>

<result> ::= <value_expression>

<coalesce_empty> ::= COALESCEEMPTY (<value_expression> 
                                 {, <value_expression> }...)

<signed_numeric_literal> ::= [<sign>]<unsigned_numeric_literal>

<unsigned_numeric_literal> ::= <exact_numeric_literal> 
                             | <approximate_numeric_literal>

<exact_numeric_literal> ::= <unsigned_integer>[.<unsigned_integer>]
                          | <unsigned_integer>.
                          | .<unsigned_integer>

<unsigned_integer> ::= {<digit>}...

<approximate_numeric_literal> ::= <mantissa>E<exponent>

<mantissa> ::= < exact_numeric_literal>

<exponent> ::= [<sign>]<unsigned_integer>

<string_value_expression> ::= <value_expression_primary>
                            | <string_value_expression>
                              <concatenation_operator>
                              <value_expression_primary>

Note   The data type of <value_expression_primary> in the above production shall be a character string.

 
<character_string_literal>::= <quote>[<character_representation>...] 
                              <quote>

<character_representation> ::= <nonquote_character> | <quote_symbol>

<nonquote_character> ::= !! 
                    <any_character_in_the_character_set_other_than_quote>

<quote_symbol> ::= <quote> <quote>

<quote>  ::= ’

<concatenation_operator> ::= ||