multiple case ... of ...

Dietmar Schäfer <>
Tue Aug 10 14:15:05 CEST 2004


Hi !

Is there anybody out ther who can tell me how to do things 
like this:


create_table() ->
       case mnesia:create_table(fourd_mib_variables, [{snmp, [{key,
string}]},  %%  o.k. ??
                 {attributes, record_info(fields, fourd_mib_variables)},
                 {disc_copies, [nodes()]}]) of
         {atomic, ok}     -> io:format("table fourd_mib_variables could
be created"),
                             ok;
         {aborted,Reason} -> io:format("creation of database failed
reason.~n ~w",[Reason]),
                             Reason
       end,


       case mnesia:create_table(command_table, [{snmp, [{key,
string}]},  %% ist das so o.k. ??
                 {attributes, record_info(fields, command_table)},
                 {disc_copies, [nodes()]}]) of
         {atomic, ok}     -> io:format("table command_table could be
created"),
                             ok;
         {aborted,Reason} -> io:format("creation of database
command_table failed reason.~n ~w",[Reason]),
                             Reason
       end.



the compiler tells me :

src/cmmc_foc.erl:38: variable 'Reason' unsafe in 'case' (line 24)
error


Best Regards !


Dietmar





More information about the erlang-questions mailing list