Skip to content

Commit

Permalink
clarification wrt. subqueries
Browse files Browse the repository at this point in the history
  • Loading branch information
hvub committed Dec 9, 2024
1 parent 82aa6c7 commit 86b1699
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/ROOT/pages/syntax/variables.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ Information regarding the naming of variables may be found xref::syntax/naming.a
.Variables are only visible in the same query part
====
Variables are not carried over to subsequent queries.
If multiple query parts are chained together using `WITH`, variables have to be listed in the `WITH` clause to be carried over to the next part.
If multiple query parts are chained together using `WITH`, variables defined in ono part have to be listed in the `WITH` clause to be carried over to the next part.
For more information see xref::clauses/with.adoc[WITH].
====

[IMPORTANT]
.Variables imported into a `CALL` subquery are visible in the whole subquery
====
Even if the subquery is a multiple query parts are chained together using `WITH`, variables imported from the outer query do not have to be listed in the `WITH` clause to be visible in the next part.
For more information see xref::subqueries/call-subquery.adoc#variable-scope-clause[The variable scope clause].
====

0 comments on commit 86b1699

Please sign in to comment.