Expressions

An expression specifies a value.

Authorization: The use of some of the expressions, such as a scalar-fullselect, sequence-reference, function-invocation, or cast-specification may require having the appropriate authorization. For these expressions, the privileges held by the authorization ID of the statement must include the following authorization:
  • global variable. For information about authorization considerations, see Global variables.
  • scalar-fullselect. For information about authorization considerations, see Queries.
  • sequence-reference. The authorization to reference the sequence. For information about authorization considerations, see Notes.
  • function-invocation. The authorization to execute a user-defined function. For information about authorization considerations, see Function invocation.
  • Start of changearray-element-specification. The authorization to reference an array type. For information about authorization considerations, see GRANT (Type Privileges).End of change
  • cast-specification. The authorization to reference a user-defined type. For information about authorization considerations, see CAST specification.
Read syntax diagramSkip visual syntax diagram
   .-operator---------------------------------.   
   V                                          |   
>>---+-----+--+-function-invocation---------+-+----------------><
     +- + -+  +-(expression)----------------+     
     '- - -'  +-constant--------------------+     
              +-column-name-----------------+     
              +-variable--------------------+     
              +-special-register------------+     
              +-scalar-fullselect-----------+     
              +-labeled-duration------------+     
              +-array-constructor-----------+     
              +-array-element-specification-+     
              +-case-expression-------------+     
              +-cast-specification----------+     
              +-OLAP-specification----------+     
              +-row-change-expression-------+     
              +-sequence-reference----------+     
              '-XMLCAST-specification-------'     

operator:

Read syntax diagramSkip visual syntax diagram
>>-+-CONCAT-+--------------------------------------------------><
   +- ∥ ----+   
   +- / ----+   
   +- * ----+   
   +- ** ---+   
   +- + ----+   
   '- - ----'   

labeled-duration:

Read syntax diagramSkip visual syntax diagram
>>-+-function-----+--+-YEAR---------+--------------------------><
   +-(expression)-+  +-YEARS--------+   
   +-constant-----+  +-MONTH--------+   
   +-column-name--+  +-MONTHS-------+   
   '-variable-----'  +-DAY----------+   
                     +-DAYS---------+   
                     +-HOUR---------+   
                     +-HOURS--------+   
                     +-MINUTE-------+   
                     +-MINUTES------+   
                     +-SECOND-------+   
                     +-SECONDS------+   
                     +-MICROSECOND--+   
                     '-MICROSECONDS-'