Peter van der Kamp wrote:
As Perl is one of the main programming languages at our institute,
Nice to hear! (Thought the Netherlands is more Python biased.)
I tried the Perl API with MonetDB-Xquery. I succeeded with sending mil statements (with the language parameter set to 'mil') to the server and getting the correct answer, but xqueries failed (with the language parameter set to 'xquery'). This was not a complete surprise as the documentation seems to be ambiguous ("MonetDB/XQuery for POSIX (Linux/Unix) platforms currently only supports MAPI (MonetDB API) to communicate with the XQuery engine."). Following the link to the API's: "Perl binding of the simple Monet API (Mapi) for MIL/SQL database interaction". So, I would like to know if my assumption that currently no xqueries are supported by the Perl API is correct.
DBD::monetdb restricts the language parameter: die "!ERROR languages permitted are 'sql', 'mal', and 'mil'\n" unless ($lang eq 'mal' || $lang eq 'sql' || $lang eq 'mil'); Drop these lines if they get in the way. There are a few conditionals in the code (to switch behavior between 'sql' and 'mil'). Maybe you need additional conditionals for 'xquery'. Thenceforward you have to fight for yourself. (Last time I battled with hierarchical databases in 1969;-) Of course, I'll help to incorporate necessary changes into the module. Steffen P.S.: For testing purposes, it may be easier to use plain MapiLib: use MapiLib; my $mapi = MapiLib::mapi_connect('localhost', 50000,'','','') or die $!; my $hdl = MapiLib::mapi_query( $mapi,'env();'); die MapiLib::mapi_error_str( $mapi ) if MapiLib::mapi_error( $mapi ); while ( MapiLib::mapi_fetch_row( $hdl ) ) { print MapiLib::mapi_fetch_field( $hdl, 0 ); }