Oh it appears to not include part of my email as I psted from the website. I thought you were being odd.
for $i in 1 to 100 return db:open('books' || $i)//book/title
and I am using exactly the same but as
for $i in 1 to 100 return db:open("RaceXML1" || $i)//meeting/race
from here http://docs.basex.org/wiki/Databases
Sayth
On Fri, 19 Aug 2016 at 21:28 Sayth Renshaw flebber.crue@gmail.com wrote:
Well following the example on the website is broken. I would like to know how to make it work and stop it concatenating the iterable to the database name and instead just iterate as expected.
Cheers
Sayth
On Fri, 19 Aug 2016 at 21:26 Christian Grün christian.gruen@gmail.com wrote:
Hi Sayth,
for $i in 1 to 100 return db:open('RaceXML1' || $i)//meeting/race What occurs though is that the iterable is concatenated to the database
name
and subsequently not found.
Error: Stopped at C:/Users/Sayth/Documents/firstquery.xq, 2/15: [bxerr:BXDB0002] Database 'RaceXML11' was not found.
To new to xquery to know why this is wrong.
I assume that you have no database called 'RaceXML11'. May I ask what’s the problem you want to see solved?
Christian
Full error is
Error: Stopped at C:/Users/Sayth/Documents/firstquery.xq, 2/15: [bxerr:BXDB0002] Database 'RaceXML11' was not found. Compiling:
- pre-evaluating (1 to 100)
- rewriting descendant-or-self step(s)
Optimized Query: for $i_0 in (1 to 100) return db:open(concat("RaceXML1", $i_0))/descendant::meeting/race Query: for $i in 1 to 100 return db:open("RaceXML1" || $i)//meeting/race Query plan:
<QueryPlan compiled="true"> <GFLWOR> <For> <Var name="$i" id="0"/> <RangeSeq from="1" to="100"/> </For> <CachedPath> <DbOpen name="open(database[,path])"> <FnConcat name="concat(atom1,atom2[,...])"> <Str value="RaceXML1" type="xs:string"/> <VarRef> <Var name="$i" id="0"/> </VarRef> </FnConcat> </DbOpen> <IterStep axis="descendant" test="meeting"/> <IterStep axis="child" test="race"/> </CachedPath> </GFLWOR> </QueryPlan>
Can you help?
Sayth