escape character in a function

From: "Patrick Hatcher" <PHatcher(at)macys(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: escape character in a function
Date: 2002-04-23 21:25:42
Message-ID: OF42F17F60.601FBF55-ON88256BA4.0074D9F1@fds.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Howdy
How do I do an escape character in a function to for a word that has an
apostrophe like: RICH'S. I tried ''RICH\'S'', but when I run my function,
I get back mismatch parentheses.
TIA

REATE FUNCTION "sp_updaterlg"() RETURNS "int4" AS '
begin
update bcp_cust
set div_name = ''RICH\'S''
where
div_store is not null
and instr(div_store,''RICH\'S'',1) >0;

return 1;
end;
' LANGUAGE 'plpgsql';

Patrick Hatcher
Macys.Com

Browse pgsql-novice by date

  From Date Subject
Next Message Joshua b. Jore 2002-04-23 22:03:32 Re: INSERT results
Previous Message Joshua b. Jore 2002-04-23 21:24:50 Re: Storing .jpg files