Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id CDA8B633B64 for ; Sun, 26 Apr 2009 23:12:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 46225-03 for ; Sun, 26 Apr 2009 23:12:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from rotring.dds.nl (rotring.dds.nl [85.17.178.138]) by mail.postgresql.org (Postfix) with ESMTP id 5AD5D63230C for ; Sun, 26 Apr 2009 23:12:50 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by rotring.dds.nl (Postfix) with ESMTP id 4EECB272C69; Mon, 27 Apr 2009 04:12:48 +0200 (CEST) Received: from [192.168.1.104] (unknown [190.12.51.7]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by rotring.dds.nl (Postfix) with ESMTP id 5D8B1272C66; Mon, 27 Apr 2009 04:12:42 +0200 (CEST) Cc: pgsql-sql@postgresql.org Message-Id: <450092BA-41F2-4CCF-9598-9F4DF2B18FFA@rvt.dds.nl> From: Ries van Twisk To: landsharkdaddy In-Reply-To: <23248274.post@talk.nabble.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Query with Parameters and Wildcards Date: Sun, 26 Apr 2009 21:12:38 -0500 References: <23248274.post@talk.nabble.com> X-Mailer: Apple Mail (2.930.3) X-Virus-Scanned: ClamAV 0.94.2/9292/Mon Apr 27 03:25:00 2009 on rotring X-Virus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200904/118 X-Sequence-Number: 32464 On Apr 26, 2009, at 7:21 PM, landsharkdaddy wrote: > > I have a query that works on SQL Server to return customers that > contain the > string entered by the user by accepting parameters and using the LIKE > keyword. I would like to move this to postgreSQL but I'm just not > sure how > to get it done. This is the query > > SELECT * FROM Customers WHERE FirstName LIKE @custfirst + '%'; > > This works great on SQL Server but not on postgreSQL. Any help would > be > appreciated. Why didn't it work? Any error message), or no result? Are you expecting case-insensitivity (try ILIKE) regards, Ries van Twisk ------------------------------------------------------------------------------------------------- Ries van Twisk tags: Freelance TYPO3 Glassfish JasperReports JasperETL Flex Blaze-DS WebORB PostgreSQL DB-Architect email: ries@vantwisk.nl web: http://www.rvantwisk.nl/ skype: callto://r.vantwisk Phone: +1-810-476-4196 SIP: +1-747-690-5133