Re: Abstract Search question

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

From: Andrew Hartford
Subject: Re: Abstract Search question
Date: 18:46 on 22 Dec 2004
Hello again, 
It occurred to me that although I can't express A and (B or C) it might be 
possible to change the logic but get the same result. 

I refreshed my knowledge of boolean algebra and now see that the equivalent of 
the above, which _can_ be expressed in SQL::Abstract, is :
(A and B) or (A and C)

That solves my problem. There is a good writeup of boolean algebra on 
everything2 
(http://www.everything2.com/index.pl?node_id=413665&lastnode_id=520379).

Andy



On Wednesday 22 December 2004 10:16 am, Andrew Hartford wrote:
> On Wednesday 22 December 2004 02:41 am, Peter Speltz wrote:
> > 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
>
> Thanks for the reply Peter! That would be a nice way to express that. I'm
> going to ping the author on this and see what he says.
>
> I was expecting to be able to use the normal syntax where items in a hash
> are and'ed together, and supply a special string for the key of the nested
> or'ed expression. Like this:
>
> { A => 'tom', NEST => [{B => 'huck'}, {C => 'jim'}] } # NEST is keyword so
> the arrayref isn't interpreted as a modified parameter expression.
>
> Andy

(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