Mnesia question
Mickael Remond
mikl@REDACTED
Mon Apr 26 08:12:37 CEST 1999
Torbjorn Tornkvist a écrit :
>
> Shouldn't you use the Boolean test operator for equality ?
> That is:
>
> task(User) ->
> Q = query
> [ T ||
> T <- table(tasks),
> U <- table(users),
> U.id == User,
> T.user_id == U.id ]
> end,
> F = fun() -> mnemosyne:eval(Q) end,
> mnesia:transaction(F).
>
> /Tobbe
No, the syntaxe of mnemosyne seems to be different. When I use the '=='
operator I get a compile error :
./task_mgr.erl:48: illegal operation (==) in database list
comprehension
In fact, I get the same no catch error with the 'company.erl' example :
Erlang (JAM) emulator version 47.4.1
Eshell V47.4.1 (abort with ^G)
(master@REDACTED)1> mnesia:start().
ok
(master@REDACTED)2> cd('../src/examples').
C:/PROJET-0.1/src/examples
ok
(master@REDACTED)3> company:init().
{atomic,ok}
(master@REDACTED)4> mnesia:load_textfile('Data').
** Table employee already exists, just entering data
** Table dept already exists, just entering data
** Table project already exists, just entering data
** Table manager already exists, just entering data
** Table at_dep already exists, just entering data
** Table in_proj already exists, just entering data
{atomic,ok}
(master@REDACTED)5> company:females().
{atomic,["Hansson Catrin","Carlsson Tuula","Fedoriw Anna"]}
(master@REDACTED)6> company:females2().
{atomic,["Hansson Catrin","Carlsson Tuula","Fedoriw Anna"]}
(master@REDACTED)7> company:female_bosses().
** exited: nocatch **
=ERROR REPORT==== 26-Apr-1999::08:09:25 ===
!!! Error in process <0.32.0> on node 'master@REDACTED' with exit value:
nocatch
I suspect a misconfiguration, but I did not see what I a missing.
Thanks in advance for your help.
Mickael Remond
More information about the erlang-questions
mailing list