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

Laura McCord Laura.McCord at doucet-austin.com
Wed May 5 15:00:13 EDT 2004


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



More information about the Zope-DB mailing list