I'm new to Zope and I'm trying to put togther a ZSQL search method. I want to take the input from the user form and create a LIKE clause rather than an = clause. This means I need to tack a percent sign onto the input. If the user enters 'Jim' I need the SQL method to create, WHERE firstname LIKE 'Jim%'. Whats the best way to do this in Zope? thanks jb
if user is the variable holding the name 'Jim' (or whatever): select * from some_table where username like <dtml-sqlvar "_.string.strip(user)+'%'" type=string> __________________________________________________________________ Jim Sanford . Database Engineer / \ / Accelerated Technology, Inc. / / 720 Oak Circle Drive East / / \ Mobile, AL 36609 / / \ Voice: 334-661-5770 fax: 334-661-5788 / \ E-Mail: jsanford@atinucleus.com Web: http://www.atinucleus.com Source Code, No Royalties, Any CPU...It just make sense ! __________________________________________________________________ ----- Original Message ----- From: JB <jimbag@kw.igs.net> To: <zope@zope.org> Sent: Friday, November 19, 1999 2:02 PM Subject: [Zope] ZSQL 'Like'
I'm new to Zope and I'm trying to put togther a ZSQL search method. I want to take the input from the user form and create a LIKE clause rather than an = clause. This means I need to tack a percent sign onto the input. If the user enters 'Jim' I need the SQL method to create, WHERE firstname LIKE 'Jim%'. Whats the best way to do this in Zope?
thanks jb
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
JB -
Jim Sanford