Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 5A75F633443 for ; Fri, 29 Jan 2010 17:17:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 37629-01 for ; Fri, 29 Jan 2010 21:17:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail.postgresql.org (Postfix) with ESMTP id 8B8486326B9 for ; Fri, 29 Jan 2010 17:17:27 -0400 (AST) Received: by leary.csoft.net (Postfix, from userid 1112) id 84CE6A39F; Fri, 29 Jan 2010 16:17:25 -0500 (EST) Date: Fri, 29 Jan 2010 16:17:25 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Andrew Lindesay cc: pgsql-jdbc@postgresql.org Subject: Re: LIKE and ESCAPING in JDBC Select Statement In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1362881414-1264799845=:31378" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.545 tagged_above=-10 required=5 tests=AWL=0.054, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/77 X-Sequence-Number: 20273 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1362881414-1264799845=:31378 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Sat, 30 Jan 2010, Andrew Lindesay wrote: > I am trying to use the JDBC LIKE escape clause with PG 8.4 and the PG > 8.4 JDBC driver. > > So far I have tried; > > SELECT ... WHERE ... AND (t0.MESSAGE ILIKE ? {escape '|'}) LIMIT 50 This works for me as attached. Please be more clear what your problem is. Kris Jurka --0-1362881414-1264799845=:31378 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=Escape.java Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=Escape.java aW1wb3J0IGphdmEuc3FsLio7DQoNCnB1YmxpYyBjbGFzcyBFc2NhcGUgew0K DQoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nIGFyZ3NbXSkgdGhy b3dzIEV4Y2VwdGlvbiB7DQoJCUNsYXNzLmZvck5hbWUoIm9yZy5wb3N0Z3Jl c3FsLkRyaXZlciIpOw0KDQoNCgkJQ29ubmVjdGlvbiBjb25uID0gRHJpdmVy TWFuYWdlci5nZXRDb25uZWN0aW9uKCJqZGJjOnBvc3RncmVzcWw6Ly9sb2Nh bGhvc3Q6NTQzMi9qdXJrYSIsICJqdXJrYSIsICIiKTsNCg0KCQlQcmVwYXJl ZFN0YXRlbWVudCBwc3RtdCA9IGNvbm4ucHJlcGFyZVN0YXRlbWVudCgiU0VM RUNUICdhJyBJTElLRSA/IHtlc2NhcGUgJ3wnfSIpOw0KCQlwc3RtdC5zZXRT dHJpbmcoMSwgInxfIik7DQoJCVJlc3VsdFNldCBycyA9IHBzdG10LmV4ZWN1 dGVRdWVyeSgpOw0KCQlycy5uZXh0KCk7DQoJCVN5c3RlbS5vdXQucHJpbnRs bihycy5nZXRCb29sZWFuKDEpKTsNCgkJcnMuY2xvc2UoKTsNCgkJcHN0bXQu Y2xvc2UoKTsNCgkJY29ubi5jbG9zZSgpOw0KCX0NCg0KfQ0KDQo= --0-1362881414-1264799845=:31378--