[Zope] Simple SQL (?)

Tino Wildenhain tino@wildenhain.de
Tue, 04 Apr 2000 10:57:15 +0200


Hi Jenny,

Jenny Campbell wrote:
> 
> Hi there
> 
> I know there's probably a really simple answer to this but I can't see it for looking. I've made an ODBC connection to a Access 97 database and am
> trying to run the following query:
> 
>                     select ph_user, ph_location, ph_directno,   ph_extension, ph_mobile_ext
>                     from tblPhone
>                     where ph_user matches '*John*'
>                     order by 1
> 
> but get the following error:
> 
> Error, sql.error: ('37000', -3100, "[Microsoft][ODBC Microsoft Access 97 Driver] Syntax error (missing  operator) in query expression 'ph_user matches
> '*John*''.")
> 
> Ideally, I would like to be able to search against a table for ph_user using their first name only and return all the other fields. Would appreciate
> any advice. We're using Zope 1.10.3

I'm not familar with Access, but most databases use something like:

like '%John%'
or ideally: like @lower('%john%') to catch all posibilities
Please refer to your Access manual for this.

If you would like to distinguish first name, second name, you could make 
seperate fields for the names.

HTH
Tino Wildenhain