|
|
| Author |
Message |
< Open Telecom Platform (OTP) ~ [Q] how to create table definition and table at runtime |
| vsp |
Posted: Sun Jun 06, 2010 4:42 am |
|
|
|
User
Joined: 03 Mar 2010
Posts: 14
|
Hello,
I need to be able to define a mnesia table (and then potentially populate it) at run time.
all the examples I saw before use -record to define a structure and then create the table.
However, in my situation it is only at runtime I can 'devise' that information.
And then I need all of my modules to be able to access this newly created table.
thanks in advance |
|
|
| Back to top |
|
| bpuzon |
Posted: Mon Jun 07, 2010 9:22 am |
|
|
|
User
Joined: 05 Aug 2009
Posts: 23
Location: Cracow, Poland
|
I think you can simply create your table on runtime using
Code:
mnesia:create_table(something, [{attributes, [some_atoms]}])
[some_atoms] does not _have_ to be created from record_info(). |
_________________ Saludos,
Bartłomiej Puzoń
Erlang Solutions |
|
| Back to top |
|
| vsp |
Posted: Mon Jun 07, 2010 5:49 pm |
|
|
|
User
Joined: 03 Mar 2010
Posts: 14
|
thank you,
but this would not allow me to 'use' the table from modules, correct?
In other words, there is no way for me to introspect a table definition and then create a 'record structure' for it ?
thank you |
|
|
| Back to top |
|
| bpuzon |
Posted: Mon Jun 07, 2010 6:42 pm |
|
|
|
User
Joined: 05 Aug 2009
Posts: 23
Location: Cracow, Poland
|
Well, records are syntactic sugar and disappear after the preprocessing. So everything you can do with records, you can do without as well.
If for some reason mnesia:table_info(table, attributes) doesn't work for you (why?) you might need to send the (generated) attributes to your other processes that wish to use the table. |
_________________ Saludos,
Bartłomiej Puzoń
Erlang Solutions |
|
| Back to top |
|
| wuji |
Posted: Sat Aug 11, 2012 2:15 am |
|
|
|
User
Joined: 10 Aug 2012
Posts: 654
|
than half a century, and a football team's worth of of Cheap Ralph Lauren Shirts of children and grandchildren."He died as he lived. He
hard until the end, stayed positive, thought only of others others replica Christian Louboutin others and constantly reminded everyone of how blessed his life
been. His ambitions were far reaching, but he never never discount designer *beep* never believed he had to leave this Happy Valley to
them. He was a man devoted to his family, family, [h4]designer replica *beep*[/h4] family, his university, his players and his community," Paterno's family
in a statement.While at Penn State's helm, Paterno, who was was [h2]replica designer bags for sale[/h2] was born in Brooklyn, N.Y., led the Nittany Lions to
undefeated seasons and two NCAA championships, had only five losing losing cheap Ralph Lauren Polo losing seasons, was inducted into the College Football Hall of |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|