query across multiple databases.
Hello,
I want to fire an XQuery across multiple databases. how to achieve this ?
Hi Kunal,
the easiest solution is to check our documentation... ;)
http://docs.basex.org/wiki/Databases http://docs.basex.org/wiki/Database_Module#db:open
Best, Christian
Hi Christian,
Thanks for sharing the documentation link. :)
I have gone through the documentation and reach to the conclusion that we can fire XQueries only on one DB at a time. we cannot run query across the DBs.
*For eg.* I am maintaining two DBs. DB 1: contains schema files. DB 2: contatins corresponding xmls.
I wont be able to fire a query obtaining datatype of an element which are specified in an xmls. ("let $ele := transaction/*[name() ne 'traInfo'] return xs:schema/xs:element[@name = $ele/local-name() and @type = 'xs:string']")
Above query will return all the elements defined in xml file which are of string datatype.
please correct me if I am wrong.
Thanks, Kunal
Quoted text · Christian Grün · 12 lines
On Wed, Aug 27, 2014 at 8:24 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Kunal, > > the easiest solution is to check our documentation... ;) > > http://docs.basex.org/wiki/Databases > http://docs.basex.org/wiki/Database_Module#db:open > > Best, > Christian >
Did you try db:open()?
Best, Christian
Quoted text · Kunal Chauhan · 48 lines
On Thu, Aug 28, 2014 at 9:15 AM, Kunal Chauhan <mail4ck at gmail.com> wrote: > Hi Christian, > > Thanks for sharing the documentation link. :) > > I have gone through the documentation and reach to the conclusion that we > can fire XQueries only on one DB at a time. we cannot run query across the > DBs. > > For eg. > I am maintaining two DBs. > DB 1: contains schema files. > DB 2: contatins corresponding xmls. > > I wont be able to fire a query obtaining datatype of an element which are > specified in an xmls. > ("let $ele := transaction/*[name() ne 'traInfo'] return > xs:schema/xs:element[@name = $ele/local-name() and @type = 'xs:string']") > > Above query will return all the elements defined in xml file which are of > string datatype. > > please correct me if I am wrong. > > Thanks, > Kunal > > > On Wed, Aug 27, 2014 at 8:24 PM, Christian Grün <christian.gruen at gmail.com> > wrote: >> >> Hi Kunal, >> >> the easiest solution is to check our documentation... ;) >> >> http://docs.basex.org/wiki/Databases >> http://docs.basex.org/wiki/Database_Module#db:open >> >> Best, >> Christian > > > > > -- > Kunal Chauhan > mail4ck at gmail.com > [+918655517141]
Written for BaseX 7.9. BaseX may have changed since: please check the current documentation.