Questions tagged [xquery-update]

Xquery-Update is for problem scenarios related to Update queries using Xquery in SQL.

using Xquery you can manage XML data-type in SQL. MSDN reference Introduction to XQuery in SQL Server 2005

74 questions
2
votes
2 answers

Add an attribute to an element in an existing XML using Xquery

I need to add an attribute to an element of my response XML using XQuery. Take the below XML as input,
JPS
  • 2,730
  • 5
  • 32
  • 54
2
votes
1 answer

xquery replacing value if node exist

I'm working with xQuery and I'm trying to replace the value of test element if the element tag Active does not exist under the User element. (I added quotes to be able to display it here properly...) declare @testXML xml = ' 10
user2355293
  • 55
  • 1
  • 7
2
votes
2 answers

XQuery to fetch and insert same time

I am retrieving data and inserting it into another file. But the inserted data is not ordered. Following is the example of what I am trying to achieve. let $n :=…
John
  • 2,820
  • 3
  • 30
  • 50
1
vote
2 answers

Why do we use [1] behind an order by clause in xquery expressions?

SELECT xText.query (' let $planes := /planes/plane return { for $x in $planes where $x/year >= 1970 order by ($x/year)[1] return ($x/make, $x/model,$x/year ) } ') FROM planes In this code, what is the purpose of [1] in…
1
vote
1 answer

XQuery Update Replace in Sedna

I'm working on a little project for school. This project asks me to show that I'm capable of using various processing techniques of XML. Now, in my project I work with the Sedna database manager in which I keep user records and I would like to…
Jan Discart
  • 167
  • 1
  • 1
  • 13
1
vote
1 answer

Replace at once all the elements of an xml document with Xquery/XUpdate

Given the following xml file: red
HOTOMOL
  • 71
  • 6
1
vote
2 answers

No updating expression allowed Basex

I am using BaseX version 8.6.6 i am getting the error while updating database expression must all be updating or return empty sequence below is the code: declare %private %updating function local:ingest-job() { let $contentpath :=…
1
vote
1 answer

Modifying Updated DOM in XQuery via XQIB

Newbie to XQuery. I am using XQIB ("XQuery In the Browser", i.e. Zorba implemented in JavaScript) to process it client-side. In the following test document, if I click the first button, "Add Paragraphs" and then the second button, "Make some…
Hugh Guiney
  • 1,309
  • 2
  • 19
  • 34
1
vote
1 answer

Replacing contents of xml attribute in xml column in DB2

I have an xml document saved in a DB2 Table with XML datatype and I want to update the value of a node. I tried this: XQUERY replace value of node db2-fn:sqlquery('select my_xml_column from myTable where someId =…
yankee
  • 38,872
  • 15
  • 103
  • 162
1
vote
1 answer

Changing node name via Xquery

I am trying to create an xquery which will change the name of the node from 'CNode3' to 'ChangedNode3' whenever the child element ('CCNode1') of 'CNode3' is 'CCValue1'. Node1 Node2
user3839347
  • 121
  • 10
1
vote
1 answer

Recursive copy of a folder with XQuery

I have to copy an entire project folder inside the MarkLogic server and instead of doing it manually I decided to do it with a recursive function, but is becoming the worst idea I have ever had. I'm having problems with the transactions and with the…
1
vote
0 answers

load xsd files into Sedna db and insert unique elements into them

kindly note that I am developing an academic project based on Sedna database 3.5, I have a database which should contains of 4 XML files each one have its own schema file, First question: how can I load those XSD files?? I had tried to load a…
scass
  • 35
  • 9
1
vote
1 answer

Multiple updates of attributes in BaseX

I'm trying to update a few attributes of a SVG tag in in a Xquery function in BaseX. So far I managed to update one attribute and returning the new node but not multiple attributes. I tried multiple updates as a variation of the statement described…
lup3x
  • 249
  • 2
  • 9
1
vote
1 answer

XQuery-Update: Target node of insert expression is not updateable

Running this code copy $foo := modify ( insert node into $foo ) return $foo in Saxon-EE 9.6.0.7 (form Oxygen 18) I get the Error Target node of insert expression is not updateable BaseX returns Who is right?…
Dill
  • 1,943
  • 4
  • 20
  • 28
1
vote
1 answer

SQL Server XML Update Serialized Array based on compound XQuery

I have a db table with an XmlProperties column with data in the form of a Serialized .NET array. Here's an example:
anderly
  • 727
  • 7
  • 16