> Not if you want to use distributed erlang.
does it mean that it is possible with distributed erlang.

Currently I have such code:

<erl>
-include_lib("stdlib/include/
qlc.hrl").

%%-include("common.hrl").
%%-include("records.hrl").

do(Q) ->
    F = fun() -> qlc:e(Q) end,
    {atomic, Val} = mnesia:transaction(F),
    Val.

keyval(K,L) ->
    {value, {K, V}} = lists:keysearch(K,1,L),
    V.

-record(suggest, {prefix, top_words}).

out(A) ->
    Arg = yaws_api:parse_query(A),

    %% search_words
    Prefix = keyval("search_words", Arg),
    SearchWords = do(qlc:q([X#suggest.top_words || X <- mnesia:table(suggest),
                            X#suggest.prefix =:= Prefix ])),

    {ehtml,
       {pre,[], f("~p", [SearchWords])}
    }.
</erl>


Will you please show a simple example to do distributed erlang?

Thanks,
~JVS


On Wed, Aug 26, 2009 at 5:30 PM, Januar V. Simarmata (G!) <januarvs@gmail.com> wrote:


On Sun, Aug 23, 2009 at 4:24 AM, Claes Wikstrom <klacke@tail-f.com> wrote:
Januar V. Simarmata (G!) wrote:
Hi,

I have created an Mnesia database in node' jvs01'.

Then I run Yaws with 'nohost@nonode'.

Is there any way to open the table in node jvs01 from Yaws script?

Not if you want to use distributed erlang. If you - as you write -
choose to not use distribution, you must set up regular sockets
to the node and send/receive term_to_binary/1 terms on the socket.

/klacke



--
Januar V. Simarmata



--
Januar V. Simarmata