[MonetDB-users] Mapi - mal

Hello, I would like to get the oid of a stored uri using the Mapi library. The mal commands that need to be executed are: tokenizer.open("rdf"); id := tokenizer.locate("http://uri"); io.print(); tokenizer.close(); I tried to run the following program ...tokenizer.open("rdf");... ... if ((hdl = mapi_query(dbh, "tokenizer.locate(\"http://uri\")")) == NULL || mapi_error(dbh) != MOK) die(dbh, hdl); if (mapi_close_handle(hdl) != MOK) die(dbh, hdl); while (mapi_fetch_row(hdl)) result=mapi_fetch_field(hdl, 0); ... ...tokenizer.close();... .. but I get the following error Mapi.mx:5141: mapi_fetch_row: Assertion `(hdl)->mid' failed. Could you tell me how can I solve this problem? Kind regards, Petros

At the very least, move the call to mapi_close_handle to *after* you're done with the handle. The call frees up all resources on the client having to do with the handle, so the handle can't be used afterwards anymore. On 2010-05-18 22:24, Petros Tsialiamanis wrote:
Hello, I would like to get the oid of a stored uri using the Mapi library. The mal commands that need to be executed are:
tokenizer.open("rdf"); id := tokenizer.locate("http://uri"); io.print(); tokenizer.close();
I tried to run the following program
...tokenizer.open("rdf");... ... if ((hdl = mapi_query(dbh, "tokenizer.locate(\"http://uri\")")) == NULL || mapi_error(dbh) != MOK) die(dbh, hdl); if (mapi_close_handle(hdl) != MOK) die(dbh, hdl); while (mapi_fetch_row(hdl)) result=mapi_fetch_field(hdl, 0); ... ...tokenizer.close();...
.. but I get the following error Mapi.mx:5141: mapi_fetch_row: Assertion `(hdl)->mid' failed.
Could you tell me how can I solve this problem?
Kind regards, Petros
------------------------------------------------------------------------------
_______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Sjoerd Mullender

Thank you for your help, I moved the mapi_close_handle, but still don't get any results ...tokenizer.open("rdf");... ... if ((hdl=mapi_query(dbh, "tokenizer.locate(\"http://uri\")"))==NULL || mapi_error(dbh)!=MOK) die(dbh, hdl); while (mapi_fetch_row(hdl)) result=mapi_fetch_field(hdl, 0); if (mapi_close_handle(hdl) != MOK) die(dbh, hdl); ... ...tokenizer.close();... Kind regards, Petros 2010/5/18 Sjoerd Mullender <sjoerd@acm.org>:
At the very least, move the call to mapi_close_handle to *after* you're done with the handle. The call frees up all resources on the client having to do with the handle, so the handle can't be used afterwards anymore.
On 2010-05-18 22:24, Petros Tsialiamanis wrote:
Hello, I would like to get the oid of a stored uri using the Mapi library. The mal commands that need to be executed are:
tokenizer.open("rdf"); id := tokenizer.locate("http://uri"); io.print(); tokenizer.close();
I tried to run the following program
...tokenizer.open("rdf");... ... if ((hdl = mapi_query(dbh, "tokenizer.locate(\"http://uri\")")) == NULL || mapi_error(dbh) != MOK) die(dbh, hdl); if (mapi_close_handle(hdl) != MOK) die(dbh, hdl); while (mapi_fetch_row(hdl)) result=mapi_fetch_field(hdl, 0); ... ...tokenizer.close();...
.. but I get the following error Mapi.mx:5141: mapi_fetch_row: Assertion `(hdl)->mid' failed.
Could you tell me how can I solve this problem?
Kind regards, Petros
------------------------------------------------------------------------------
_______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Sjoerd Mullender
------------------------------------------------------------------------------
_______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
participants (2)
-
Petros Tsialiamanis
-
Sjoerd Mullender