summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-10-20 09:27:37 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-10-20 09:27:37 -0400
commite60654674f6c4acd3edb8fe7e6df5139a6d43d21 (patch)
tree18f09b71f3b8518d707609cdfa864637003254b5 /doc
parentaa7c1c71c48c8829e59800d15849ad0d99205918 (diff)
Some notes on 'T' for update/delete combinators
Diffstat (limited to 'doc')
-rw-r--r--doc/manual.tex4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/manual.tex b/doc/manual.tex
index 541dd96b..872dca93 100644
--- a/doc/manual.tex
+++ b/doc/manual.tex
@@ -1870,14 +1870,14 @@ $$\begin{array}{l}
\hspace{.1in} \to \$(\mt{map} \; (\mt{sql\_exp} \; [] \; [] \; []) \; \mt{fields}) \to \mt{dml}
\end{array}$$
-An $\mt{UPDATE}$ command is formed from a choice of which table fields to leave alone and which to change, along with an expression to use to compute the new value of each changed field and a $\mt{WHERE}$ clause.
+An $\mt{UPDATE}$ command is formed from a choice of which table fields to leave alone and which to change, along with an expression to use to compute the new value of each changed field and a $\mt{WHERE}$ clause. Note that, in the table environment applied to expressions, the table being updated is hardcoded at the name $\mt{T}$. The parsing extension for $\mt{UPDATE}$ will elaborate all table-free field references to use table variable $\mt{T}$.
$$\begin{array}{l}
\mt{val} \; \mt{update} : \mt{unchanged} ::: \{\mt{Type}\} \to \mt{changed} :: \{\mt{Type}\} \to [\mt{changed} \sim \mt{unchanged}] \\
\hspace{.1in} \Rightarrow \$(\mt{map} \; (\mt{sql\_exp} \; [\mt{T} = \mt{changed} \rc \mt{unchanged}] \; [] \; []) \; \mt{changed}) \\
\hspace{.1in} \to \mt{sql\_table} \; (\mt{changed} \rc \mt{unchanged}) \to \mt{sql\_exp} \; [\mt{T} = \mt{changed} \rc \mt{unchanged}] \; [] \; [] \; \mt{bool} \to \mt{dml}
\end{array}$$
-A $\mt{DELETE}$ command is formed from a table and a $\mt{WHERE}$ clause.
+A $\mt{DELETE}$ command is formed from a table and a $\mt{WHERE}$ clause. The above use of $\mt{T}$ is repeated.
$$\begin{array}{l}
\mt{val} \; \mt{delete} : \mt{fields} ::: \{\mt{Type}\} \to \mt{sql\_table} \; \mt{fields} \to \mt{sql\_exp} \; [\mt{T} = \mt{fields}] \; [] \; [] \; \mt{bool} \to \mt{dml}
\end{array}$$