[erlang-questions] Mnesia queries

Ulf Wiger (TN/EAB) <>
Tue Dec 11 15:43:41 CET 2007

Bob Cowdery skrev:
> I need a little help with mnesia queries. I want to parameterise the query but can't seem to find any examples of how to do that. The general form seems to be
> qlc:q([X#rec.bar || X <- mnesia:table(foo), X#rec.bar == baz])
> If I now want to select columns at run time is there some way I can construct the left side of the qlc.
> Thanks
> Bob

Do you mean something like this?

qlc:q([{X#rec.bar, X#rec.baz} || X <- mnesia:table(foo), ...])

Ulf W

More information about the erlang-questions mailing list