perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Spoerri <j...@yucs.org>
Subject Re: chaining Links ?$db -> TableLink ('kapitel' , '-up', {'!Table' => 'kapitel', '!MainField' => 'kapitel_id', '!LinkedFi
Date Sun, 10 Aug 2003 23:02:07 GMT
Excellent, thank you.

On Sun, 10 Aug 2003, Gerald Richter wrote:

> Am Montag, 4. August 2003 05:47 schrieb Joshua Spoerri:
> > I don't think this is my case.
> >
> > In the example, table A has field "B_id", but table B has field
> > "C_id_with_another_name".
> >
>
> Ah I see the problem, in this case you have to presetup this information using
> the TableLink method and  a DBIx::Database object, something like:
>
> $db -> TableLink ('B' , '-C',  {'!Table' => 'C',
>                                      '!MainField' => 'C_id_with_another_name',
>                                        '!LinkedField' => 'id'} ) ;
>
> Hope this helps
>
> Gerald
>
>
>
>
> > So I don't need a "!Links" parameter for A to B, and of course my B
> > recordset object has a "!Links" parameter connecting B to C, but when A
> > links to B, it is to _the table B_, and not to _the recordset object B_,
> > so it doesn't know that the _table_ referred to by $A{-B} should have a
> > {-C} entry. It can't be automatically detected.
> >
> > The reason that I can't just name the field C_id instead of
> > C_id_with_another_name is because there are actually two different links
> > from B to C.
> >
> > On Sun, 3 Aug 2003, Gerald Richter wrote:
> > > Am Freitag, 1. August 2003 02:53 schrieb Joshua Spoerri:
> > > > Is it possible to chain Linked tables?
> > > >
> > > > I would like to do $A{-B}{-C}{someFieldOnC} but the link from table B
> > > > to table C is not automatically detectable.
> > >
> > > There are some limitation in the implementation of Perl  tied hashes, so
> > > you have to write
> > >
> > > $b = $A{-B} ;
> > > $c = $b -> {-C} ;
> > > $c -> {someFieldsOnC} ;
> > >
> > > That's a problem of Perl itself not of DBIx::Recodrset
> > >
> > > Gerald
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message