ets结合record的增删改查操作

具体请看:http://www.iteye.com/topic/689089

12> ets:new(test,[named_table,public,set,{keypos,1}]).         
test
13> ets:insert(test,{21,'ssdfsdf'}).                 
true
14> ets:foldl(fun(A,AC)->io:format("Data:~p~n",[A]) end,0,test).
Data:{21,ssdfsdf}
ok
15> ets:lookup(test,21).                                       
[{21,ssdfsdf}]
16> ets:foldl(fun(A,AC)->io:format("Data:~p~n",[A]) end,0,test).
Data:{21,ssdfsdf}
ok
17> ets:update_element(test,21,{2,'fffeeea'}).                 
true
18> ets:foldl(fun(A,AC)->io:format("Data:~p~n",[A]) end,0,test).
Data:{21,fffeeea}
ok

你可能感兴趣的:(table,insert,fun)