select-statement

The select-statement is the form of a query that can be directly specified in a DECLARE CURSOR or FOR statement, prepared and then referenced in a DECLARE CURSOR statement, or directly specified in an SQLJ assignment clause. It can also be issued interactively. In any case, the table specified by a select-statement is the result of the fullselect.

Read syntax diagramSkip visual syntax diagram
>>-+--------------------------------------------------+--------->
   |                      .-,-----------------------. |   
   |                      V                         | |   
   '-WITH--+-----------+----common-table-expression-+-'   
           '-RECURSIVE-'                                  

>--fullselect--------------------------------------------------->

   .-----------------------------------------.           
   V                                         | (1) (2)   
>----+-------------------------------------+-+-----------------><
     +-update-clause-----------------------+             
     +-read-only-clause--------------------+             
     +-optimize-clause---------------------+             
     +-isolation-clause--------------------+             
     '-concurrent-access-resolution-clause-'             

Notes:
  1. The update-clause and read-only-clause cannot both be specified in the same select-statement.
  2. Each clause may be specified only once.
RECURSIVE
Indicates that a common-table-expression is potentially recursive.