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
1
vote
0 answers

Preserving whitespace while updating XML

I'm trying to create an automated release script that can update several Maven pom files. At present the "release script" is a text file containing instructions and some example sed commands which assume that the old version number will always be…
smithkm
  • 231
  • 1
  • 9
1
vote
1 answer

XQuery Update - Add new node to group nodes

I have an XML file with following structure -
John
  • 2,820
  • 3
  • 30
  • 50
1
vote
1 answer

How to use XQuery to Update an Attribute in BaseX XML Database?

I am using BaseX to store XML data with multiple item nodes in the following format: Root
1
vote
0 answers

How to update XML data using XQuery or XQuery with embedded SQL using FLWOR expression in IBM DB2?

I have a database table in IBM DB2 v10.5.1 with a column with datatype XML. I want to perform an UPDATE or DELETE on the XML data using XQuery (possibly with embedded SQL using a FLWOR expression). FLWOR expressions are normally used to query data,…
Earl Lapura
  • 165
  • 2
  • 12
1
vote
1 answer

Move a node and its descendents from parent to a sibling

I have an XML tree as follows: A1 A2 ... ... An B1 B2 ... ... Bm
Rachcha
  • 8,486
  • 8
  • 48
  • 70
1
vote
1 answer

Replace value of empty XML node in SQL Server's XQuery

I tried the following ways and could not find a way to replace empty node value without deleting it and without using XML attributes. Replace node is not available in MS-SQL. DECLARE @doc xml SET @doc = ' 1 ' print '1) ' +…
alpav
  • 2,972
  • 3
  • 37
  • 47
1
vote
0 answers

How to update an XML column in DB2 with XMLQuery?

I want to update an XML column in DB2 with dynamic values or you can say with values that I'll pick from another table and insert them in the xml column. I know how to insert a node along with its value that we provide by hard coding it,…
Superman
  • 871
  • 2
  • 13
  • 31
1
vote
1 answer

Update multiple XML files using XQuery and Zorba

Is there a simple way using the Zorba XQuery Processor to update multiple XML files and save the output of the modification back in the same file? So far I have figured out how to process multiple files using the File module and the file:list…
deemen
  • 118
  • 6
1
vote
1 answer

BaseX XQuery replace

I have the following problem. I want to replace a value of an element in my xquery-file by using baseX as the database. The xquery code is as follows: let $db := doc('update.xml') replace value of node $db//elem with 'haha' return
1
vote
2 answers

Can I make XQuery evaluate { $expression } within variables bound with XQJ?

To mimic an auto-increment value in XQuery Update, the following works fine, assuming when running this for the first time: let $count := /root/@count return ( insert node into /root, replace value of…
Arjan
  • 22,808
  • 11
  • 61
  • 71
1
vote
3 answers

Insert element into XML using XQuery and Java

I need to insert a new element into an XML document using XQuery insert expression. I am using saxon as a java api. I am new to XQuery so I am not sure about the exact structure of the insert expression. Can anyone help me in this please. My XML…
Lucy
  • 471
  • 4
  • 12
  • 28
1
vote
1 answer

XQuery: why does this transform modify the source document?

I'm working with this very simple XML doc (that I borrowed from a tutorial), books-mod.xml: Everyday Italian Giada De…
FatalError
  • 52,695
  • 14
  • 99
  • 116
0
votes
2 answers

Xquery delete type query using lookup list

Need help constructing xquery to delete data from XML File that contains data for Google Products data feed. I have a long list of ID numbers in a spreadsheet column that need to be removed - these are numeric. Below is the xml schema. I need to…
Dan M
  • 13
  • 2
0
votes
1 answer

How to run Saxon on an XQuery Update file from the command line?

This page [1] on the Saxon web site says: Update is available only in Saxon-EE, and is supported only if explicitly requested. The command line has an option -update:on for this purpose ... and Note that updates to a document will fail unless it…
Roger Costello
  • 3,007
  • 1
  • 22
  • 43
0
votes
1 answer

Update all attributes of a node in XQUERY

I have a node with attributes and children. I have a second node with a different set of attributes: I want to replace all attributes of…
haael
  • 972
  • 2
  • 10
  • 22