[erlang-questions] Mnesia Dirty select -> use of "or" in guards

Ulf Wiger ulf@REDACTED
Sat May 25 19:40:34 CEST 2013


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/20130525/fb727802/attachment.htm>


More information about the erlang-questions mailing list