Updating variables in xquery
Therefore a simple "store" or "put" function, applied to the result of such transformation, could seem sufficient to achieve any kind of database update operation. In practice this would be neither very natural, convenient, nor very efficient (such an approach requires storing back the whole document and makes optimizing very difficult).
So as we will see the little complexity added by XQuery Update seems quite worth the effort.
It also introduces block expressions, which may contain statements and thus also have side effects.
We are looking forward to its wide adoption as the language of choice for updating XML databases.At the time this tutorial was written, there were already a few implementations: Monet DB (CWI), Qizx (XMLmind), Oracle Berkeley DB XML (Oracle), XQilla. At least on Zorba, this is called the Zorba Scripting Extension (scroll to the bottom, header "Scripting") which adds side-effecting imperative programming constructs to XQuery.In addition to its side effects, a sequential expression may return an XDM instance.The classification of each expression into one of the above categories is performed by static analysis.