[CDBI] Trying to model query in Class::DBI

Alan Griffiths ap_griffiths at hotmail.com
Thu Jan 5 13:27:48 GMT 2006


Thanks for the link. The following worked for me: -

__PACKAGE__->set_sql(
    by_country_presence => qq{
    SELECT c.__ESSENTIAL__
    FROM   carrier c, carrier_presence cp, location l
    WHERE  c.carrier_id = cp.carrier_id
    AND    cp.location_id = l.location_id
    AND    l.country_id = ?
}
);

Alan


>From: Perrin Harkins <perrin at elem.com>
>To: Alan Griffiths <ap_griffiths at hotmail.com>
>CC: classdbi at svr02.digitalcraftsmen.net
>Subject: Re: [CDBI] Trying to model query in Class::DBI
>Date: Wed, 04 Jan 2006 13:30:45 -0500
>
>On Wed, 2006-01-04 at 18:07 +0000, Alan Griffiths wrote:
> > Hi,
> >
> > I'm trying to model the following query in Class::DBI: -
> >
> > SELECT c.name
> > FROM carrier c, carrier_presence cp, location l
> > WHERE c.carrier_id = cp.carrier_id
> > AND cp.location_id = l.location_id
> > AND l.country_id = 1;
> >
> > I thought that DeepAbstractSearch would do the trick, but after
> > reading the documentation it seems not. I'm sure that this is
> > possible, but I'm just missing something.
>
>Is there a reason you don't want to use the SQL you already wrote?  Have
>you read this?
>http://wiki.class-dbi.com/wiki/Using_joins
>
>- Perrin
>






More information about the ClassDBI mailing list