Re: plpgsql.. SELECT INTO ... WHERE FIELD LIKE

From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: plpgsql.. SELECT INTO ... WHERE FIELD LIKE
Date: 2004-12-17 03:33:49
Message-ID: 32f2ctF3laeu6U1@individual.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Try:
SELECT INTO RS ID FROM CUSTOMER WHERE FIRSTNAME LIKE KEYWORD || ''%'' LIMIT 1;

You append KEYWORD and a '%' together using ||. You need to use
doubled quotes inside the quoted environment; one gets stripped off so
that the stored procedure will contain the query

SELECT INTO RS ID FROM CUSTOMER WHERE FIRSTNAME LIKE KEYWORD || '%'' LIMIT 1;
--
let name="cbbrowne" and tld="gmail.com" in name ^ "@" ^ tld;;
http://linuxfinances.info/info/sgml.html
C is almost a real language. (see assembler) Even the name sounds like
it's gone through an optimizing compiler. Get rid of all of those
stupid brackets and we'll talk. (see LISP)

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Keith Worthington 2004-12-17 04:05:20 FUNCTION, TRIGGER and best practices
Previous Message Christopher Browne 2004-12-17 03:08:13 Re: plpgsql.. SELECT INTO ... WHERE FIELD LIKE