Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I want a list of all the films in which a given actor stared. Note that Role has two primary keys.package Role; Role->table('role'); Role->columns(Primary => qw/film actor/); Role->has_a(film => 'Film'); package Film; Film->table('film'); Film->columns(All => qw/id title rating/); Film->has_many(stars => [ Role => 'actor' ]);
Or even better;$film = Film->search(title => 'Jaws'); $film->stars;
Can I coax Class::DBI into this?$stars = Film->search(title => 'Jaws')->stars;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Basic Class::DBI question
by perrin (Chancellor) on Feb 01, 2006 at 04:36 UTC | |
|
Re: Basic Class::DBI question
by davidrw (Prior) on Feb 01, 2006 at 04:37 UTC |