Changes

Jump to navigation Jump to search
254 bytes added ,  13:56, 30 January 2013
==db:create==
{{Mark|Introduced Updated with Version 7.5:}}allow more than one input and path. 
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:create|$db as xs:string|empty-sequence()}}<br/>{{Func|db:create|$db as xs:string, $input inputs as item()*|empty-sequence()}}<br/>{{Func|db:create|$db as xs:string, $input inputs as item()*, $path paths as xs:string*|empty-sequence()}}
|-
| '''Summary'''
|Creates a new database with name {{Code|$db}} and adds the initial document documents specified via {{Code|$inputinputs}} to the specified {{Code|$pathpaths}}.<br/>{{Code|$inputinputs}} may be a string strings or a node nodes different than attributeattributes. If the {{Code|$input}} source is not a file or a folder, the {{Code|$pathpaths}} must be specifiedargument is mandatory.<br/>Please note that {{Code|db:create}} will be placed last on the [[XQuery Update#Pending Update List|Pending Update List]]. As a consequence, a newly created database cannot be addressed in the same query.
|-
| '''Errors'''
|{{Error|FODC0002|XQuery Errors#Functions Errors}} {{Code|$inputinputs}} points to an unknown resource.<br/>{{Error|FOUP0001|XQuery Errors#Update Errors}} {{Code|$inputinputs}} is neither string nor a document node.<br/>{{Error|BXDB0007|#Errors}} {{Code|$db}} is opened by another process.<br/>{{Error|BXDB0011|#Errors}} {{Code|$db}} is not a [[Commands#Valid_Names|valid database name]].<br/>{{Error|BXDB0012|#Errors}} two {{Code|db:create}} statements with the same database name were specified.<br/>{{Error|BXDB0013|#Errors}} the number of specified input and paths differs.
|-
| '''Examples'''
* {{Code|db:create("DB", <a/>, "doc.xml")}} creates the database {{Code|DB}} and adds the document with content {{Code|&lt;a/&gt;}} under the name {{Code|doc.xml}}.
* {{Code|db:create("DB", "/home/dir/", "docs/dir")}} creates the database {{Code|DB}} and adds the documents in {{Code|/home/dir}} to the database under the path {{Code|docs/dir}}.
* {{Code|db:create("DB", file:list('.'))}} adds all files of the current working directory to a new database.
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu