Dear Gene, I'm not sure, whether MonetDB's PHP interface has ever been tested with XQuery; hence, we're very much interested in your experiences and feedback ;-) Regarding the error you encounter, this is due to the fact that your query is not correct XQuery. Instead of count(1,2,3,4) you probably meant count((1,2,3,4)) right? You can also check, whether MonetDB/XQuery (or more precisely its Pathfinder XQuery compiler) does "like" your queries by checking them with the stand-alone compiler "pf", or with "mclient" (the latter requires a running MonetDB/XQuery server): $ echo 'count(1,2,3,4)' | pf > /tmp/x.mil error in function application: at (1,1-1,14): wrong number of arguments for function `fn:count' (expected 1, got 4) # halted in /ufs/manegold/_/scratch0/Monet/Testing/Stable/source/pathfinder/compiler/semantics/functions.c (check_fun_usage), line 361 $ mclient -lxquery -s'count(1,2,3,4)' MAPI = monetdb@localhost:50000 QUERY = count(1,2,3,4) ERROR = !error in function application: at (1,1-1,14): wrong number of arguments for function `fn:count' (expected 1, got 4) !# halted in !# /ufs/manegold/_/scratch0/Monet/Testing/Stable/source/pathfinder/compiler/semantics/functions.c !# /(check_fun_usage), line 361 $ mclient -lxquery -s'count((1,2,3,4))' 4 $ echo 'count((1,2,3,4))' | pf > /tmp/y.mil $ wc -l /tmp/[xy].mil 0 /tmp/x.mil 110 /tmp/y.mil 110 total Hope this helps you further... Stefan On Sat, Aug 08, 2009 at 07:56:40AM -0600, Gene Stevens wrote:
Hi everyone,
I am a new MonetDB user. I am specifically interested in MonetDB's XQuery support with client access through PHP.
I currently get parsing errors when trying any kind of XQuery through the PHP module. I'm wondering if this is a a bug in the client or if I am possibly doing something wrong. E.g.:
#!/usr/bin/env php <?php $db = monetdb_connect('xquery', 'localhost', 50000, 'monetdb', 'monetdb') or die ("Failed to connect\n"); $query = 'count(1,2,3,4)'; $res = monetdb_query($query); ?>
Results in:
Warning: monetdb_query(): Query failed: parse error: syntax error, unexpected ;, expecting $end on line 1, column 15 (next token is `;') !parse error: XQuery parsing failed in /home/user/monet.php on line 6
... for any variation of an XQuery. I have tried the server from the Ubuntu repository as well as I've built it from source with the same results.
Here is my environment:
PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23 2009 14:37:14) Ubuntu 9.04: Linux ubuntu 2.6.28-11-server #42-Ubuntu SMP Fri Apr 17 02:45:36 UTC 2009 x86_64 GNU/Linux
Mserver --dbinit="module(pathfinder);" # MonetDB Server v4.30.4 # based on GDK v1.30.4 # Copyright (c) 1993-July 2008, CWI. All rights reserved. # Copyright (c) August 2008-2009, MonetDB B.V.. All rights reserved. # Compiled for x86_64-pc-linux-gnu/64bit with 64bit OIDs; dynamically linked. # Visit http://monetdb.cwi.nl/ for further information. # PF/Tijah module v0.13.0 loaded. http://dbappl.cs.utwente.nl/pftijah # MonetDB/XQuery module v0.28.3 loaded (default back-end is 'algebra') # XRPC administrative console at http://127.0.0.1:50001/admin MonetDB>
Thanks for any insight! - Gene Stevens
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |