Re: Abstract Search question
[prev]
[thread]
[next]
[Date index for 2004/12/22]
--- 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)
|