Hi Hector, Hi Jan,

i can reproduce the error with BaseX 6.6.1...strange.

java -cp BaseX.jar org.basex.BaseXClient -Uadmin -Padmin -c"xquery let $i := 10 return $i"
Error: Stopped at line 1, column 12: 
Syntax: XQUERY [query]
  Evaluate XQuery.

We will have a look at it.

-- Andreas

Am 19.04.2011 um 20:27 schrieb Jan Vlčinský (CAD):

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




--
Ing. Jan Vlčinský
CAD programy
Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic
tel: +420-597 602 024; mob: +420-608 979 040
skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com
http://cz.linkedin.com/in/vlcinsky

_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk