Search Results

Search found 2 results on 1 pages for 'maryjanne'.

Page 1/1 | 1 

  • mnesia primary key

    - by maryjanne
    Hi I have two tables one notes and one tag and I want to make the id from notes primary key to use it in the tag table, but I don't know where I do wrong. My notes id is generate from another table counter, with the function dirty_update_counter. My function for the id_notes from tag looks like this: Fun = fun() -> mnesia:write(#tag{ id_note =0}) end, mnesia:transaction(Fun). generate_Oid(TableName) when is_atom(TableName) -> F = fun() -> [Oid] = mnesia:read(tag, TableName, write), NewId = Oid#tag.id_note+1, New = Oid#tag{id_note = NewId}, mnesia:write(New), NewId end, mnesia:transaction(F). insert_n(N) when is_record(N, note) -> F = fun() -> {atomic, Id} = generate_Oid(note), New = N#note{id = Id}, mnesia:write(New), New end, mnesia:transaction(F). find_n(Id) when is_integer(Id) -> {atomic, [N]} = mnesia:transaction(fun() -> mnesia:read({note, Id}) end), N. But this function don't increment my field id_note from the table tag, despite the fact that in my note table, my id field is incremented from counter table. Thanks in advance for any help.

    Read the article

  • How to connect Nitrogen with Couchdb using Ecouch

    - by maryjanne
    I don't understand how to make a connection with nitrogen and couchdb using ecouch, because I have a error on this connection CAUGHT ERROR: error-undef [{ecouch,db_info,["test_suite_db"]} I put ecouch in my erlang library path and I create a symlink to support/include.mk (even I don't know if it has necessary). Or if anyone know a database how can connect with nitrogen and who to make this connection.

    Read the article

1