Re: Abstract Search question

[prev] [thread] [next] [Date index for 2004/12/22]

From: Peter Speltz
Subject: Re: Abstract Search question
Date: 07:41 on 22 Dec 2004
--- Peter Speltz <peterspeltz@xxxxx.xxx> wrote:

> 
> --- Andrew Hartford <ahartford@xxxxxxxxxx.xxx> wrote:
> 
> > I've got a question about the SQL::Abstract where format used by 
> > Class::DBI::AbstractSearch. I hope this isn't too out of place here.
> > 
> > I'm trying to construct a where clause with the following logic: 
> >  WHERE A = ? and (B = ? or C = ?).
> > 
> 
> In docs it looks like you can only specify one logical operator to use betwen
> columns. That's  too bad as what you want is impossible from what i can tell.
> Too bad the "logic" parameter can't be an array ref to map to use between the
> %where keys.
> 
> 

To clarify, i'm talking about being able to write statement like this:
my @objs = $class->search_where( { A => 'tom',
                                   B => 'huck',
                                   C => 'jim' } ,
                                  { logic => [ 'AND', 'OR'] } );
 and this would generate the:
WHERE A = ? and (B = ? or C = ?) .

So every time you need 'logic' you shift one off if size > 1 or use the one
element without shifting. So the last one becomes default for all subsequent
times 'logic' is needed.


=====
pjs

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

(message missing)

Abstract Search question
Andrew Hartford 23:13 on 21 Dec 2004

Re: Abstract Search question
Peter Speltz 07:22 on 22 Dec 2004

Re: Abstract Search question
Peter Speltz 07:41 on 22 Dec 2004

Re: Abstract Search question
Andrew Hartford 15:16 on 22 Dec 2004

Re: Abstract Search question
Andrew Hartford 18:46 on 22 Dec 2004

Re: Abstract Search question
Peter Speltz 18:56 on 22 Dec 2004

Re: Abstract Search question
Andrew Hartford 15:21 on 23 Dec 2004

Re: Abstract Search question
Tim Bunce 16:39 on 23 Dec 2004

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52