From: Mike Mascari <mascarm@mascari.com>
To: pgsql-interfaces@postgresql.org
Subject: [INTERFACES] Pattern matching fun via ODBC
Date: Mon, 20 Dec 1999 08:17:10 -0500
Message-ID: <385E2C56.7355C6F2@mascari.com> (raw)
>David C Hartwig Jr wrote:
>
> Mike Mascari wrote:
>
> > Hello,
> >
> > SELECT workorders.workorder, workorders.workorderno,
> > equipment.assetno, equipment.controlno
> > FROM workorders, equipment
> > WHERE equipment.assetno LIKE '%214%'
> > AND workorders.equipment=equipment.equipment
> > ORDER BY workorders.workorder;
> >
> > gets re-written by Access as this:
> >
> > "SELECT "workorders"."workorder","equipment"."equipment"
> > FROM "equipment","workorders"
> > WHERE (("equipment"."assetno" = '%214%' )
> > AND ("workorders"."equipment" = "equipment"."equipment" ) )
> > ORDER BY "workorders"."workorder"
>
> I don't have Access 97 installed on any of my systems at this time, so
> I cam not verify what I am about to say. But I seem to recall that
> Access uses asterisk (*) as the wild card character. I think it is
> the MS Jet Engine that is transforming your statements. I believe the
> Jet sees the percent (%) character as just another character and so in
> its infinite wisdom optimizes for you - transforming the LIKE to an
> equal (=). Pretty thoughtful of them. :>(
>
> I believe (in the context of a LIKE expression) the Jet will transform
> your asterisks (*) to percents (%).
Unbelievable!
You're absolutely correct. I had tried using asterisks with
the equality operator, but I had never thought to use both
LIKE and asterisks. Wow! Thanks...
Mike Mascari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: mascarm@mascari.com
Subject: Re: [INTERFACES] Pattern matching fun via ODBC
In-Reply-To: <385E2C56.7355C6F2@mascari.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox