home | tech | misc | code | bookmarks (broken) | contact | README


Erlang notes

Troubleshooting

Error with Mnesia: "no function clause matching ..."

If you get a crypt error like that:

4> test:vai().
** exception error: no function clause matching
        test:'-customer_all/0-lc$^0/1-0-'({qlc_handle,
               {qlc_table,#Fun<mnesia.20.112329951>,true,
                #Fun<mnesia.21.62211129>,
                #Fun<mnesia.22.75429001>,
                #Fun<mnesia.23.26336897>,
                #Fun<mnesia.26.62819299>,
                #Fun<mnesia.25.51075493>,
                #Fun<mnesia.24.47804912>,'=:=',undefined,
                no_match_spec}})
     in function  test:customer_all/0

Check if you insert the following line on the top of your file:

-include_lib("stdlib/include/qlc.hrl").

The inclusion of the qlc.hrl header is necessary if you want to use Mnesia in your module. Got this tip from this reference.