Hi Graydon,

If you use a recent version of BaseX, I recommend you to have a look at job:execute [1].

> xs:anyURI('updating-query-1.xq') => xquery:eval-update(),
> xs:anyURI('updating-query-2.xq') => xquery:eval-update()

With xquery:update, all updates will end up on the same pending update list [2], which means that they will be executed at the very end of the evaluation of your query. See the link for more information on the general semantics of XQuery Update.

Hope this helps,
Christian

[1] https://docs.basex.org/12/Job_Functions#job:execute
[2] https://docs.basex.org/main/Updates#pending_update_list



Graydon Saunders <graydonish@fastmail.com> schrieb am Di., 10. Juni 2025, 16:03:
Hello!

So if I have a number of updating queries, what's the best way to write a query that will run all of them in some fixed order? (I am doing this from the GUI.) All the individual updating queries do what they're expected to do and it works if I run them in sequence from the GUI, query one, query two, and so on. If I try to chain them together:

xs:anyURI('updating-query-1.xq') => xquery:eval-update(),
xs:anyURI('updating-query-2.xq') => xquery:eval-update()

Seems to work OK for the first two or three and then to start having issues (in the sense that the updates don't appear to happen to the target) if I chain four or five together. (The updating queries get the db name to update from a common xquery  module.)

It also looks inelegant, like there ought to be a better way.

Anyone got any suggestions? Or is this not a sensible thing to be attempting?

Thanks!
Graydon