table_info on remote table

Fredrik Thulin <>
Fri Feb 24 07:29:25 CET 2006


On Friday 24 February 2006 03:32,  wrote:
> Hi,
>
> I have a question regarding table_info. How does one make it work
> with a remote table ?
...

I beleive I had the same problem once. I got the following piece of code 
from Chandrashekhar Mullaparthi, which solved it for me at least. Try 
if it works for you or if your problem is actually another one.

%%--------------------------------------------------------------------
%% Function: generic_table_info(Tab, Item)
%%           Tab  = atom(), table name
%%           Item = atom(), item we are interested in
%% Descrip.: Get mnesia table information, regardless of where table
%%           resides.
%% Returns : term()
%%--------------------------------------------------------------------
generic_table_info(Tab, Item) ->
    Info = fun(T, I) ->
              mnesia:table_info(T, I)
           end,
    mnesia:activity(async_dirty, Info, [Tab, Item], mnesia_frag).

/Fredrik



More information about the erlang-questions mailing list