Re: Couple of questions...

Mario Ruggier <[email protected]> Wed, 21 Apr 2004 10:20:32 +0200
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
Hello!

I had come across these kind of limitations a few months ago... not 
developing at the moment, but I find the issue interesting... so, just 
my 2 centimes ;)

> This makes me think that it could be nice to have something like
>
>>>> ec.fetch('Writer', 'NOT EXISTS(books.publisher.bizName!="P1")'

I would say yes this would be very nice to have... and this almost 
seems to me a consistent and natural extension of what is supported 
already, i.e. 'AND', 'OR', 'NOT', 'IN', 'NOT IN', 'like', ilike', ... 
anything else?

Almost... because EXISTS applies to a independent subquery, while the 
other keywords are constraints on the current query. Would this be a 
possible source of confusion?

What happens if we intermix these keywords, e.g.

ec.fetch('Writer', 'books.publisher.numPages>50
AND (books.publisher.bizName IN ["P1","P2"])
AND NOT EXISTS(books.publisher.bizName NOT IN ["P1","p2"] ) '

to get the authors that have books with at least 51 pages as well as 
having published with both of P1 and P2 but with no one else. Would 
this work? There would be a simpler way to do this?

mario



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click