Mnemosyne query by a partial key

Carlos Silva <>
Wed Jan 22 15:51:58 CET 2003

Hi everybody.

I'd like to know if it is possible to include a function call in the body of a Mnemosyne query. Knowing that a query is declared as: query [ <pattern> || <body> ] end

The doubt comes to me when I tried to run this example:
          Q = query [{E.item, E.url} || E <- table(menus), element(1, E.item) = Level] end,

but a "{aborted,mnemosyne_not_running}" is all I've obtained from the shell :o(

Neither I could run my example in this way:
    Menus = #menus{item = '$1'},
    Guard = {'==','element(1, $1)',Level},
    mnesia:select(menus, [{Menus , [Guard], [['$1','$2']]}])

I'd be happy if someone could tell me how to execute a query by a partial key, when the key of a Mnesia table is a compound key as {elem1, elem2, elem3} and I want to search only by elem1 for example.

Thanks a lot,

Ing. Carlos E. Silva
INSwitch Solutions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the erlang-questions mailing list