[erlang-questions] ETS In Erlang

Lucky Khoza <>
Tue Nov 27 10:00:20 CET 2012


Hi Kenneth,

I'm coming from T-SQL background, so does it mean that {keypos,pos} denotes
an example of a primary key if you understand what I mean.

On Tue, Nov 27, 2012 at 9:18 AM, Kenneth Lundin <>wrote:

> From the documentation of ets:
>
> {keypos,Pos} Specfies which element inthe stored tuples should be used as
> key. By default, it is the first element, i.e. Pos=1.However, this is not
> always appropriate. In particular, we do not want the first element to be
> the key if we want to store Erlang records in a table.
>
> Note that any tuple stored in the table must have at least Pos number of
> elements.
>
> http://erlang.org/doc/man/ets
>
> The keypos option does not change the tuples that are stored in the table,
> it just
> tell which element that should be used as key for the table in question.
>
> /Kenneth Erlang/OTP Ericsson
> Den 27 nov 2012 07:47 skrev "Lucky Khoza" <>:
>
>> Hi Erlang Developers,
>>
>> I would like to ask about this tuple {keypos,pos} when creating set
>> collection in Erlang Term Storage collection.
>>
>> What is the effect of this tuple in the collection? What does it do on
>> the collection's rows?
>>
>> Thanks for your help in advance
>>
>> Kindest Regards
>> Lucky
>>
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121127/53c95872/attachment.html>


More information about the erlang-questions mailing list