Changes

Jump to navigation Jump to search
167 bytes added ,  16:29, 27 April 2012
Small example for db:output()
It is not possible to mix different types of expressions in a query result. The outermost expression of a query must either be a collection of updating or non-updating expressions. There is no way to perform any updating queries and return a result at the same time, except for using the BaseX-specific [[Database Module#db:output|db:output()]] function, which caches the results of its arguments at runtime and returns it after all updates have been processed.
 
Example: Perform update and return success message.
 
<pre class="brush:xquery">
db:output("Update successful."), insert node <c/> into doc('factbook')/mondial
</pre>
Trying to modify and return a DOM node within the same snapshot is another story. As changes on DOM nodes are non-persistent, you cannot access them in a subsequent query. This is where the [[Update#transform|transform expression]] comes into play.
administrator, Bureaucrats, editor, reviewer, Administrators
57

edits

Navigation menu