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

[prev] [thread] [next] [Date index for 2006/01/05]

From: Alan Griffiths
Subject: Re: [CDBI] Trying to model query in Class::DBI
Date: 13:27 on 05 Jan 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@xxxx.xxx>
>To: Alan Griffiths <ap_griffiths@xxxxxxx.xxx>
>CC: classdbi@xxxxx.xxxxxxxxxxxxxxxx.xxx
>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
>



_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Trying to model query in Class::DBI
Alan Griffiths 18:07 on 04 Jan 2006

Re: [CDBI] Trying to model query in Class::DBI
Perrin Harkins 18:30 on 04 Jan 2006

Re: [CDBI] Trying to model query in Class::DBI
Alan Griffiths 13:27 on 05 Jan 2006

Generated at 01:21 on 10 Jan 2006 by mariachi v0.52