Jump to navigation Jump to search
1,070 bytes added ,  12:31, 8 November 2012
no edit summary
'''Important note:''' All functions in this section are ''updating functions'': they will not be immediately executed, but queued on the [[XQuery Update#Pending Update List|Pending Update List]], which will be processed after the actual query has been evaluated. This means that the order in which the functions are specified in the query does usually not reflect the order in which the code will be evaluated.
{{Mark|Introduced with Version 7.5:}}
| width='90' | '''Signatures'''
|{{Func|db:create|$db as xs:string|empty-sequence()}}<br/>{{Func|db:create|$db as xs:string, $input as item()|empty-sequence()}}<br/>{{Func|db:create|$db as xs:string, $input as item(), $path as xs:string|empty-sequence()}}
| '''Summary'''
|Creates a new database with name {{Code|$db}} and adds the initial document {{Code|$input}} to the specified {{Code|$path}}.<br/>{{Code|$input}} may be a string or a node different than attribute. If the {{Code|$input}} source is not a file or a folder, {{Code|$path}} must be specified.
| '''Errors'''
|{{Error|FODC0002|XQuery Errors#Functions Errors}} {{Code|$input}} points to an unknown resource.<br/>{{Error|FOUP0001|XQuery Errors#Update Errors}} {{Code|$input}} is neither string nor a document node.<br/>{{Error|FOUP...|XQuery Errors#Update Errors}} ...
| '''Examples'''
* {{Code|db:create("DB", "/home/dir/doc.xml")}} creates the database {{Code|DB}} and adds the file {{Code|/home/dir/doc.xml}} as initial content.
administrator, Bureaucrats, editor, reviewer, Administrators


Navigation menu