Re: Query with Parameters and Wildcards

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: landsharkdaddy <ldodd(at)landsharksoftware(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Query with Parameters and Wildcards
Date: 2009-04-27 04:54:17
Message-ID: dcc563d10904262154n19dd9f77pe81fe23eebeeac2e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sun, Apr 26, 2009 at 6:21 PM, landsharkdaddy
<ldodd(at)landsharksoftware(dot)com> 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?

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message landsharkdaddy 2009-04-27 05:01:14 Re: Query with Parameters and Wildcards
Previous Message Ries van Twisk 2009-04-27 02:12:38 Re: Query with Parameters and Wildcards