[Zope-DB] Z sql Method and using 'OR'

Andreas Jung andreas at andreas-jung.com
Wed May 5 15:09:53 EDT 2004

I recommend looking at the RDBMS chapter in the Zope Books.....there are 
enough examples
and solutions for your problem.


--On Mittwoch, 5. Mai 2004 14:00 Uhr -0500 Laura McCord 
<Laura.McCord at doucet-austin.com> wrote:

> I wrote a sql method and the OR is not really working. I want to be able
> to either search for a user by name or search by location. But the way
> it is now is if I only enter a name such as 'Jill' in the name field and
> click search. The query ends up searching for anyone whose name is
> 'Jill' and anyone with NULL in the office field.
> What am I doing wrong because now I can see why I am getting that error
> but unsure how to revise my query.
> select * from users
> where
> (username = '<dtml-var name="username" sql_quote>' OR
> useroffice = '<dtml-var name="useroffice" sql_quote>')
> -Laura
> _______________________________________________
> Zope-DB mailing list
> Zope-DB at zope.org
> http://mail.zope.org/mailman/listinfo/zope-db

More information about the Zope-DB mailing list