mnesia db dir

Róbert Balogh (IJ/ETH) <>
Sun Jul 10 15:31:10 CEST 2005

Hej mnesia experts,

I'm a beginner in mnesia and I have some questions about mnesia. Sorry but I couldn't find the answer for these in the mnesia doc :-(

The first question is it possible to set the path of the mnesia db from "code". I mean is there other way than erl -sname nodename -mnesia dir '"dirpath"'?

I wrote a small code for learning mnesia and I take a big "discovery". It's not possible to insert any record in the table, if the table name is different that the name of his record. 
Here is my example:




-record(rPerson,{name = [],
                city = []}).


    Fun = fun()->
            mnesia:write(table,#rPerson{name = Value},write)

After calling insert I got this in the erlang shell:
()5> ex_mnesia:insert(aa).

If I change the name of table to rPerson it's possible to insert records in the table. So is that true that no way to set different name the table as his record name or I did something wrong?

Here is what I got after change table name:
()3> ex_mnesia:insert(aa).

thanks a lot the answers,


More information about the erlang-questions mailing list