Thanks, it works fine. Kristian
01.12.2017 18:44 Kirsten, Dirk kirjutas:
Hello Kristian,
XQUERY just executes actual XQuery code, so you can simply import the module as you normally would. So something like
XQUERY import module namespace up = 'http://your.namespace' at 'your-module-location.xqm'; up:updateFunctionA()
should work fine.
Cheers Dirk
** Senacor Technologies Aktiengesellschaft - Sitz: Eschborn - Amtsgericht Frankfurt am Main - Reg.-Nr.: HRB 105546 Vorstand: Matthias Tomann, Marcus Purzer - Aufsichtsratsvorsitzender: Daniel Grözinger
-----Ursprüngliche Nachricht----- Von: basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de] Im Auftrag von Kristian Kankainen Gesendet: Freitag, 1. Dezember 2017 17:30 An: BaseX basex-talk@mailman.uni-konstanz.de Betreff: [basex-talk] Scripting and modules
Hello,
I need to run several updating queries in sequel on a database and a good candidate for this should be a simple .bxs script. But is there a convenient way to reference functions defined in an external module? I have all functions defined in an external XQuery module and I would like to be able to write the script in such a way, that I use just the names of the allready defined functions. E.g something like this:
# script.bxs # open the database OPEN testdb; # make backup of the initial state CREATE BACKUP init; # run all updating queries XQUERY updateFunctionA(); XQUERY updateFunctionB(); # etc ... # make a backup of the final state CREATE BACKUP final;
I guess I can recap my question with just the following: what would be the most convenient way for me to organize this kind of automation of running allready defined module functions?
Thank you, Kristian K