Hi Hector I run query like you, only using my existing database name and counting my elements, which exists there and I had no problem. I suspected that before : shall be a space, but this is not the case, it makes no difference in my test:
D:\opt\BaseX>java -cp BaseX.jar org.basex.BaseXClient -Uadmin -Padmin -c"open ISO;xquery <results>{ let $total:=count(//LOCT) return <total>{$total}</total>}</results>" <results> <total>1487</total> </results>
I use BaseX version 6.6.1
1. What version of BaseX do you use? 2. Are you sure you run the same version for server and for the client? Once I had troubles mixing different versions.
With best regards
Jan 2011/4/19 Hector Diaz hectordanieldg@gmail.com
Hello, I am trying to run some Xqueries from command line but I am getting the following error:
$ java -cp "C:\Program Files\BaseX\BaseX.jar" org.basex.BaseXClient -Uadmin -Pa dmin -c"open dbname;xquery <results>{ let $total:=count(//callRecords/*) return <t otal>{$total}</total>}</results>" Error: Stopped at line 1, column 30: [XPST0003] Expecting "}", found ":".
If I run the query from the GUI it runs correctly, but here I am always getting this error.
I tried running other dummy queries that work in the GUI but here I get an error like this: $ java -cp "C:\Program Files\BaseX\BaseX.jar" org.basex.BaseXClient -Uadmin -Pa dmin -c"open dbname;xquery let $total := count(//callRecords/*) return $total" Error: Stopped at line 1, column 23: Syntax: XQUERY [query] Evaluate XQuery.
Any idea of how to solve this? Is it possible to use let in queries from command?
Thanks in advance for your help. Hector
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk