table_info on remote table

Michael McDaniel erlang@REDACTED
Fri Feb 24 08:04:05 CET 2006


On Fri, Feb 24, 2006 at 07:29:25AM +0100, Fredrik Thulin wrote:
> On Friday 24 February 2006 03:32, tty@REDACTED 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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Cool !   That worked for getting 'all' info on my remote table.

  Thanks Fredrik for reprinting this, and thanks Chandru for
  publishing it originally.


~Michael



More information about the erlang-questions mailing list