DOH! Thanks for the help, I seem to be a little dsylexic today ;-> Now it works, but SET WRITEBACK true doesn't seem to be working: DROP DB oshb-morphology CREATE DB oshb-morphology ADD ./morphhb/wlc SET WRITEBACK true XQUERY ./xquery/merge-proper-nouns-oshb.xq EXPORT ./out This query does an update. If I run the same query in the GUI, it works, but not in this ... um ... bxs file. What do I do to enable updates? Jonathan On Mon, Jun 28, 2021 at 3:57 PM Martin Honnen <martin.honnen@gmx.de> wrote:
On 28.06.2021 20:54, Jonathan Robie wrote:
I decided to try creating some command files to simplify administration:
https://docs.basex.org/wiki/Commands#String_Syntax <https://docs.basex.org/wiki/Commands#String_Syntax>
I was surprised that this did not work:
% cat foo.bsx
CREATE DB test
ADD TO embedded.xml <root>embedded</root>
# run query
XQUERY <hits>{ count(//text()) }</hits>
CLOSE
% basex foo.bsx
Stopped at /.../foo.bsx, 1/9:
[XPST0003] Unexpected end of query: 'DB test...'.
I think the suffix of the file needs to be ".bxs" to be treated as a command sequence, otherwise it is treated as XQuery code. So you have the wrong file suffix.