Hi,
I just noticed that when I use a db that is opened this way, I cannot do updates anymore.
Example: declare variable $_:PUB := db:open('PUB') update {};
Then, inside updating function:
let $sec := $_:PUB//Section[@Guid = $id] return replace node trace($sec) with <Section>changed</Section>
There is no error whatsoever, the update simply doesnt happen. (BaseX 8.4.4)
Bug?
Regards, Max
Hi Max,
I just copied it in my BaseX instance and it (imho correctly) returned the error message "Copy expression is incomplete" as "update {}" is invalid (if you want to update nothing it should be an empty sequence).
However, given this works I would not be surprised if this does not update the database. As you probably know "update" is just a more convenient way of using the copy/modify/transform espression. However, this will not update the original element, but instead create a copy and update this.
So I would expect your variable $_:PUB to hold a main memory copy of the database and this variable will be modified, i.e. your original database will remain the same.
Hope this helps, Dirk
On 07/22/2016 12:17 PM, Maximilian Gärber wrote:
Hi,
I just noticed that when I use a db that is opened this way, I cannot do updates anymore.
Example: declare variable $_:PUB := db:open('PUB') update {};
Then, inside updating function:
let $sec := $_:PUB//Section[@Guid = $id] return replace node trace($sec) with <Section>changed</Section>
There is no error whatsoever, the update simply doesnt happen. (BaseX 8.4.4)
Bug?
Regards, Max
basex-talk@mailman.uni-konstanz.de