[erlang-questions] Mnesia create a table with a auto increase id?

fei wang fei@REDACTED
Tue Mar 17 07:21:34 CET 2009


I am now using mnesia database, and I have a user table with record
#users{
          uid,
          username,
          password
          }

Problem one is if a username is already in the table, it would not be
inserted into the table. Should I first query the table to see if there is a
same name in it?  Any other good methods?

Problem tow is the uid should be auto increased each insert time, I have no
idea about this... Should I change the type of table to ordered-set, and
query the last record's uid value, increase it by myself?

If anyone have some good idea, or something about mnesia which I don't know,
please tell me, thanks.


Oizys
-- 
--

---------------
       致
礼!


王飞
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090317/7b2bbf4e/attachment.htm>


More information about the erlang-questions mailing list