Changes

Jump to navigation Jump to search
106 bytes added ,  19:20, 18 July 2022
no edit summary
|-
| '''Summary'''
|Replaces an XQuery Stores a value resource specified by {{Code|$input}} in the database {{Code|$db}} and the location specified by {{Code|$path}}. Existing resources are overwritten. The value can be an arbitrary sequence of atomic items, nodes, maps, or adds it as new resourceand arrays.
|-
| '''Errors'''
|
* {{Code|db:put('DB', 1 to 10000, 'sequence')}} stores a numeric range in the database.
* With the following query, you a map with countries and associated cities is stored in a database. The value resource can copy the XQuery values of one database into anothere.g. be used as index in future queries:
<syntaxhighlight lang="xquery">
let $db := 'db'put(let $src-path := 'src/factbook',let $trg-path map:= 'trg/'merge( for $src country in db:listopen($db, $src-path'factbook')//countrywhere db return map:typeentry($dbcountry/@name, $srccountry//city/name ! string() = 'value'let $trg := $trg-path || substring-after($src, $src-path)return db:put($db, db:get($db, $src ), $trg 'cities')</syntaxhighlight>
|}
|-
| '''Summary'''
|Replaces Stores a binary resource specified by {{Code|$input}} in the database {{Code|$db}} and the location specified by {{Code|$path}}, or adds it as new resource. Existing resources are overwritten.
|-
| '''Errors'''
|
* {{Code|db:put-binary('DB', file:read-binary('video.mov'), 'video/sample.mov')}} stores the addressed video file at the specified location.
* With the following query, you can copy the binaries binary resources of one database into another:
<syntaxhighlight lang="xquery">
let $db := 'db'
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu