From: Michael W. <wes...@ja...> - 2021-08-09 01:41:22
|
Hi Gary, See the "counter" module built into eXist. let $dummy := counter:create('file-ids') let $new-file-path := xmldb:store("/db/docs", concat(counter:next-value('file-ids'), '.xml'), $doc) let $dummy := counter:destroy('file-ids') Hope this helps. Take care. 2021年8月9日(月) 2:44 Gary via Exist-open <exi...@li...>: > Hi Guys, > > Is there an eXistDB sequence generator function I can use inside an XQuery? > > I would like to create documents from an XQuery along these lines. > > let $new-file-path := xmldb:store("/db/docs", > concat(xmldb:sequence-generator(), '.xml'), $doc) > > I am looking for a way to safely set, reset and persist counters and > create a series of unique document names from each time the query is run > e.g. 1.xml, 2.xml 3.xml etc. > > Kind Regards > Gary > Solution Architect > https://www.rapport.net > https://assistive.care > https://q.rip > > Rapport Network CIC > Registered in Scotland: SC458540 > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > -- Michael Westbay Writer/System Administrator http://www.japanesebaseball.com/ |