Skip site navigation (1) Skip section navigation (2)

Problem with LIKE in Access and ODBC

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Problem with LIKE in Access and ODBC
Date: 1999-12-13 21:29:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces

I was wondering if there's something here I'm not seeing (or am unaware
of) with respect to the use of LIKE in Microsoft Access over ODBC to
PostgreSQL 6.5.0 using the ODBC driver. I have the following

SELECT workorders.workorder, workorders.workorderno, equipment.assetno,
FROM workorders, equipment
WHERE equipment.assetno LIKE '%214%' AND
ORDER BY workorders.workorder;

When I just "copy-and-paste" this query into a psql session, everything
works fine (although if I recall correctly, 6.5.0 has a bug with
something of the form LIKE '214%'). However, the following appears in
the trace log:

MSACCESS        fff8be35:fffa52c5 EXIT  S
QLExecDirect  with return code 0 (SQL_SUCCESS)
  HSTMT               0x057d0b60
  UCHAR *             0x051c1828 [      -3]
"SELECT "workorders"."workorder","equipment"."equipment" FROM
"workorders","equipment" WHERE
(("equipment"."assetno" = '%214%' ) AND
("workorders"."equipment" = "equipment"."equipment" ) )
ORDER BY "workorders"."workorder"  \ 0"
  SDWORD                    -3

MSACCESS        fff8be35:fffa52c5 ENTER SQLFetch
  HSTMT               0x057d0b60

MSACCESS        fff8be35:fffa52c5 EXIT  SQLFetch  with
return code 100 (SQL_NO_DATA_FOUND)
  HSTMT               0x057d0b60

So I'm wondering who's turning my LIKE clause into an equality operator?

Is this a Microsoft Access issue? Is there a method of pattern matching
available that wouldn't require me to use the direct pass-thru method?

Any help would be greatly appreciated,

Mike Mascari

pgsql-interfaces by date

Next:From: Peter EisentrautDate: 1999-12-13 23:28:28
Subject: Re: [GENERAL] [GENERAL/INTERFACES] Dynamically detecting need to vacuum?
Previous:From: Umar GoldeliDate: 1999-12-13 21:25:18
Subject: unsubscribe

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group