Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id EDEF0633128 for ; Mon, 27 Apr 2009 02:01:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 86592-02 for ; Mon, 27 Apr 2009 02:01:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mail.postgresql.org (Postfix) with ESMTP id 6D372632ECC for ; Mon, 27 Apr 2009 02:01:16 -0300 (ADT) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LyIxu-0004B3-MB for pgsql-sql@postgresql.org; Sun, 26 Apr 2009 22:01:14 -0700 Message-ID: <23250153.post@talk.nabble.com> Date: Sun, 26 Apr 2009 22:01:14 -0700 (PDT) From: landsharkdaddy To: pgsql-sql@postgresql.org Subject: Re: Query with Parameters and Wildcards In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: ldodd@landsharksoftware.com References: <23248274.post@talk.nabble.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/120 X-Sequence-Number: 32466 I have not tried that but I will in the morning. The @ in SQL is used to indicate a parameter passed to the query. In PostgreSQL it seems that the : is the same as the @ in SQL Server. I tried something like: SELECT * FROM Customers WHERE FirstName LIKE :custfirst + '%'; And it told me that the + could not be used. Not sure the exact message but I will check again tomorrow and see what it was and post the results. Scott Marlowe-2 wrote: > > On Sun, Apr 26, 2009 at 6: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. > > Have you tried: > > SELECT * FROM Customers WHERE FirstName LIKE 'custfirst%'; > > What does the @ do in sql server? > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > > -- View this message in context: http://www.nabble.com/Query-with-Parameters-and-Wildcards-tp23248274p23250153.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com.