[erlang-questions] Mnesia Dirty select -> use of "or" in guards
Manoj Raj
rajmanoj.bottle@REDACTED
Sun May 26 15:06:18 CEST 2013
Thanks for the code sir...It works great...
On Sat, May 25, 2013 at 11:10 PM, Ulf Wiger <ulf@REDACTED> wrote:
>
> Try [ {'or', {'==', '$2', "public"}, {'==', '$2', "universal"}} ]
>
> BR,
> Ulf W
>
> On 25 May 2013, at 13:50, Manoj Raj wrote:
>
> Hi,
>
> I have the following record schema saved in the table(eg)
>
> -record(details,{user,age,hobby,status}).
>
> I want to select the hobby from the mnesia table when the status is
> "public" or "universal"
>
> I have written the following query for testing
>
> mnesia:dirty_select(details,
> [
> {
> #details{ user= "manoj", _ = '_', hobby = '$1', status='$2' },
> [{'==', '$2', "public"}],
> ['$1']
> }
> ]).
>
> It works fine...How should i add orelse inside the guard sequence...I want
> to check whether status is equal to "public" or "universal"...
>
> Is there a way or should i go the qlc way?
>
> Thank you
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
> Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
> http://feuerlabs.com
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130526/351f7613/attachment.htm>
More information about the erlang-questions
mailing list