| Author |
Message |
< Erlyweb mailing list ~ change from [value,..] to [{fieldname,value},..]? |
| Guest |
Posted: Wed Jul 30, 2008 2:41 pm |
|
|
|
Guest
|
Am I missing a function somewhere to change the resulting array of
module:find(..) from [value, ... ] to something like [{fielname,
value}, ... ] like is used to set a new entry?
regards, Ruud
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Wed Jul 30, 2008 5:41 pm |
|
|
|
Guest
|
No, there is no such function. You could do it as follows:
Values = [{Field, module:Field(Rec)} || Field <-
module:db_field_names(), Rec <- module:find()]
On Wed, Jul 30, 2008 at 7:28 AM, Ruud <ruud.prein@gmail.com> wrote:
>
> Am I missing a function somewhere to change the resulting array of
> module:find(..) from [value, ... ] to something like [{fielname,
> value}, ... ] like is used to set a new entry?
>
> regards, Ruud
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Wed Jul 30, 2008 5:55 pm |
|
|
|
Guest
|
note: this would work when find() returns just one result.
On Wed, Jul 30, 2008 at 10:41 AM, Yariv Sadan <yarivsadan@gmail.com> wrote:
> No, there is no such function. You could do it as follows:
>
> Values = [{Field, module:Field(Rec)} || Field <-
> module:db_field_names(), Rec <- module:find()]
>
> On Wed, Jul 30, 2008 at 7:28 AM, Ruud <ruud.prein@gmail.com> wrote:
>>
>> Am I missing a function somewhere to change the resulting array of
>> module:find(..) from [value, ... ] to something like [{fielname,
>> value}, ... ] like is used to set a new entry?
>>
>> regards, Ruud
>> >>
>>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Thu Jul 31, 2008 7:15 am |
|
|
|
Guest
|
This could be done with find_first/3.
Thanx for the quick reply.
regards, Ruud
On Jul 30, 7:42 |
|
|
| 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 cannot attach files in this forum You cannot download files in this forum
|
|
|