[erlang-questions] Re: Mnesia Read/Write question.

G.S. corticalcomputer@REDACTED
Fri Jul 31 09:02:29 CEST 2009


Hello,

Maria, I'm not having problems with the B) version, only with A). (The error
you noted was due to my misspelling it in the email).

Could syntax in "A)" be deprecated? I got it from Mnesia A Distributed
Robust DBMS for Telecommunications Applications, which I think was published
in 98 or earlier.

Regards,
-Gene

On Thu, Jul 30, 2009 at 11:04 PM, Steve Davis <
steven.charles.davis@REDACTED> wrote:

> Hello Gene,
>
> It looks like #test.id is the key, not #test.item. In the first
> example, I suspect id is undefined. In the second it is. To find by
> item, which appears to be what you are trying to do in (A), you would
> have to use matches.
>
> /sd
>
> On Jul 30, 11:19 pm, "G.S." <corticalcompu...@REDACTED> wrote:
> > Hello everyone,
> > This is probably a very stupid question/problem, but I'm having trouble
> > using the following commands:
> >
> > A) mnesia:dirty_write(Id#test{item = hello}) and
> > mnesia:dirty_read(Id#test.item)  I get: exception error: {badrecord,test}
> > but this works on the same table/schema...:
> > B) Thing = #test{id = 1, item = hello}, mnesia:dirty_write(test,Thing),
> > mnesia:dirty_read(test,Id).
> >
> > Are "A)" valid commands, what am I doing wrong?
> >
> > Regards,
> > -Gene
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
>
>


More information about the erlang-questions mailing list