LIKE and ESCAPING in JDBC Select Statement

From: Andrew Lindesay <apl(at)lindesay(dot)co(dot)nz>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: LIKE and ESCAPING in JDBC Select Statement
Date: 2010-01-29 20:02:50
Message-ID: EBA5F58E-BE84-4AB0-AB8B-72167B21295E@lindesay.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello;

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
SELECT ... WHERE ... AND (t0.MESSAGE ILIKE ?) {escape '|'} LIMIT 50
SELECT ... WHERE ... AND (t0.MESSAGE ILIKE ?) LIMIT 50 {escape '|'}

It seems that there is a problem with all of them. If anybody has used this before and could give me some guidance, that would be great.

Regards;

___
Andrew Lindesay
www.lindesay.co.nz

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2010-01-29 21:17:25 Re: LIKE and ESCAPING in JDBC Select Statement
Previous Message Wolfgang Rinnert 2010-01-28 18:52:28 Re: java.net.SocketException: Network is unreachable