Changes

Jump to navigation Jump to search
96 bytes removed ,  20:43, 18 July 2022
no edit summary
By default, it is not possible to mix different types of expressions in a query result. The root expression of a query must be a sequence of updating expressions. But there are two ways out:
* The BaseX-specific <code>[[{{Function|Update Module#update:output|update:output()]]</code> }} function bridges this gap: it caches the results of its arguments at runtime and returns them after all updates have been processed. The following example performs an update and returns a success message:
<syntaxhighlight lang="xquery">
* Updates on main-memory instances of files that have been retrieved via {{Code|fn:doc}} or {{Code|fn:collection}} will be propagated back to disk if {{Option|WRITEBACK}} is turned on. This option can also be activated on [[Command-Line Options#BaseX Standalone|command line]] via <code>-u</code>. Make sure you back up the original documents before running your queries.
* Functions like <code>{{Function|Code|fn:put}}</code> or <code>[[{{Function|File Module#file:write|file:write]]</code> }} can be used to write single XML documents to disk. With <code>[[{{Function|File Module#file:write-binary|file:write-binary]]</code>}}, you can write binary resources.
* The [[Commands#EXPORT|EXPORT]] command can be used write all resources of a databases to disk.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu