RE: [CDBI] What is the best way to search for record of table based on criteria of a field of its child table?
[prev]
[thread]
[next]
[Date index for 2006/01/09]
Check out Class::DBI::Sweet. Just scan through synopsis, and you'll see the
join and multi-step join syntax which sounds like exactly what you are
looking for.
> -----Original Message-----
> From: classdbi-bounces@xxxxx.xxxxxxxxxxxxxxxx.xxx
> [mailto:classdbi-bounces@xxxxx.xxxxxxxxxxxxxxxx.xxx]On Behalf Of Sai
> Tong
> Sent: Friday, January 06, 2006 10:11 AM
> To: classdbi@xxxxx.xxxxxxxxxxxxxxxx.xxx
> Subject: [CDBI] What is the best way to search for record of table based
> on criteria of a field of its child table?
>
>
> Given two tables:
>
> table A -- Music::Artist
> tha has a one-to-many relationship with
> table B -- Music::CD with the following setup:
>
> Music::Artist->has_many(cds => 'Music::CD');
> Music::CD->columns(All => qw/cdid artist title year reldate/);
> Music::CD->has_a(artist => 'Music::Artist');
>
> Is it possible to do the following with Class:DBI
>
> Music::Artist -> search( Music::Artist->cds->year => 1990 )
>
> ?
>
> What is the best way to search for records of table A based on criteria
> of a field of its child table like table B?
>
>
>
>
> _______________________________________________
> ClassDBI mailing list
> ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
> http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
>
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
|
|
RE: [CDBI] What is the best way to search for record of table based on criteria of a field of its child table?
Kate Yoak 09:55 on 09 Jan 2006
|