|
From: Chris W. <ch...@cw...> - 2003-03-17 12:35:44
|
Peter Dragon wrote:
> I've been trying to use SPOPS to retrieve fields from multiple tables, could
> you advise me on the best way to do this ?
>
> It works fine for searching but I had difficuly getting fields from a
> secondary table, because they were not part of the primary SPOPS object. One
> way round it was to use the field alter in the SPOPS configuration file to
> assign the value to a new field, e.g when searching on a task but needing a
> related contact name.
> 'field_alter' => {
> 'tk_contact_name' => 'contact.cn_name',
>
> This worked alright on fetch but I couldn't get at contact name and SPOPS
> failed on the update even though I didn't want to update the secondary
> table.
SPOPS isn't really built to merge fields from multiple tables into a
single object. Behind the scenes with SELECT statements it prepends
the table name in front of everything so you can do a painless join
statement in fetch_group().
That said, I'll look into it a little more deeply later.
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|