XQuery multiple update/insert/delete
639445May 18 2008 — edited May 19 2008Deleting/updating single nodes works fine with the API, but how would one do that in a batch process?
Example:
I want to insert nodes <x><y/><z/></x> into all Children of the Root of a document.
insert nodes <x><y/><z/></x> into doc('dbxml:/myDB/myContainer')/Root/Child
Gives out the following error:
Error: Sequence does not match type node() - the sequence contains more than one item [err:XUTY0005], <query>:13:1, errcode = QUERY_EVALUATION_ERROR
However, the following also doesn't work:
for $i in doc('dbxml:/myDB/myContainer')/Root/Child
insert nodes <x><y/><z/></x> into $i
(return something or no return)
Error: syntax error, unexpected insert, expecting return [err:XPST0003], <query>:14:7, errcode = QUERY_PARSER_ERROR
Is there a solution or workaround for my issue?