<div dir="ltr"><div>Remove the tuple in the second call:</div><div><br></div>mnesia:index_read(?TABLE, MemberID, 3) <div>vs</div><div>mnesia:index_read({?TABLE, Penname, 5})<br><br>/Dan<br><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 22, 2017 at 9:15 PM <<a href="mailto:lloyd@writersglen.com">lloyd@writersglen.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
Initialized table:<br>
<br>
init_table() -><br>
mnesia:create_table(?TABLE,<br>
[ {disc_copies, [node()] },<br>
{attributes, record_info(fields, ?TABLE)},<br>
{index, [member_id, penname]}<br>
]).<br>
<br>
Checked info:<br>
<br>
$ wg_schema(wg_table).<br>
....<br>
{index,3} -> 376866<br>
{index,5} -> 380964<br>
<br>
This query works:<br>
<br>
get_author_by_member_id(MemberID) -><br>
Query =<br>
fun() -><br>
mnesia:index_read(?TABLE, MemberID, 3)<br>
end,<br>
{atomic, Result} = mnesia:transaction(Query),<br>
Result.<br>
<br>
But this doesn't:<br>
<br>
get_author_by_penname(Penname) -><br>
Query =<br>
fun() -><br>
mnesia:index_read({?TABLE, Penname, 5})<br>
end,<br>
{atomic, Result} = mnesia:transaction(Query),<br>
{length(Result), Result}.<br>
<br>
Am I doing something wrong? Or is there something I should be doing altogether?<br>
<br>
Thanks to all,<br>
<br>
LRP<br>
<br>
<br>
<br>
<br>
*********************************************<br>
My books:<br>
<br>
THE GOSPEL OF ASHES<br>
<a href="http://thegospelofashes.com" rel="noreferrer" target="_blank">http://thegospelofashes.com</a><br>
<br>
Strength is not enough. Do they have the courage<br>
and the cunning? Can they survive long enough to<br>
save the lives of millions?<br>
<br>
FREEIN' PANCHO<br>
<a href="http://freeinpancho.com" rel="noreferrer" target="_blank">http://freeinpancho.com</a><br>
<br>
A community of misfits help a troubled boy find his way<br>
<br>
AYA TAKEO<br>
<a href="http://ayatakeo.com" rel="noreferrer" target="_blank">http://ayatakeo.com</a><br>
<br>
Star-crossed love, war and power in an alternative<br>
universe<br>
<br>
Available through Amazon or by request from your<br>
favorite bookstore<br>
<br>
<br>
**********************************************<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div></div></div>