Successive update queries for restxq

Thursday, 19 December 2013 · 2 messages
TR
Tojo Rakotoarison19 Dec 2013 16:02 #
Hi, I would like to make successive updates on a database using RESTXQ. For example : db:create(...) then db:add(...) on the newly created database. But, it seems impossible to do it in the same query because of the order in which the functions are processed. Is there a workaround for that without asking the user to send two requests manually ? For example, if there could be a way to redirect to a new query or Restxq, or something like that. Thanks ! Best regards,
CG
Christian Grün19 Dec 2013 16:08 #
Hi Tojo,
Quoted text · Tojo Rakotoarison · 6 lines
> I would like to make successive updates on a database using RESTXQ. > For example : > db:create(...) then db:add(...) on the newly created database. > > But, it seems impossible to do it in the same query because of the order in > which the functions are processed.
True, that’s not possible. With RESTXQ, the usual way is to use the forward and redirect features [1]. If you write scripts, the command script syntax will allow you to perform sequential update operations on a database [2]. If you only use, db:create and db:abb, the third alternative is to pass on initial input to the create function [3] (but you probably have seen that anyway). [1] http://docs.basex.org/wiki/RESTXQ#Forwards_and_Redirects [2] http://docs.basex.org/wiki/Commands#Command_Scripts [3] http://docs.basex.org/wiki/Database_Module#db:create
Quoted text · Tojo Rakotoarison · 18 lines
On Thu, Dec 19, 2013 at 4:02 PM, Tojo Rakotoarison <tojo.urs at gmail.com> wrote: > Hi, > > > Is there a workaround for that without asking the user to send two requests > manually ? > For example, if there could be a way to redirect to a new query or Restxq, > or something like that. > > Thanks ! > Best regards, > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >

⚡Generated with XQuery