a) If a <with clause> WC immediately contains RECURSIVE, then WC and its <with list
element>s are said to be potentially recursive. Otherwise they are said to be non-recursive.
b) Let n be the number of <with list element>s and let WLEi and WLEj be the i-th and j-th
<with list element>s for every (i,j) with i ranging from 1 (one) to n and j ranging from i+1
to n. If WLEi is not potentially recursive, then it shall not immediately contain the <query
name> immediately contained in WLEj.
c) If the <with clause> is non-recursive, then for all i between 1 (one) and n, the scope of the
<query name> WQN immediately contained in WLEi is the <query expression> immediately
contained in every <with list element> WLEk, where k ranges from i+1 to n, and the <query
expression body> immediately contained in <query expression>. A <table or query name>
contained in this scope that immediately contains WQN is a query name in scope.
d) If the <with clause> is potentially recursive, then for all i between 1 (one) and n, the scope
of the <query name> WQN immediately contained in WLEi is the <query expression>
immediately contained in every <with list element> WLEk, where k ranges from 1 (one) to
n, and the <query expression body> immediately contained in <query expression>. A <table
or query name> contained in this scope that immediately contains WQN is a query name in
scope.
Partager