| From: | "Russ Brown" <russ(at)dot4dot(dot)plus(dot)com> |
|---|---|
| To: | <pgsql-general(at)postgresql(dot)org> |
| Subject: | Difficulty with quotes |
| Date: | 2003-06-17 10:48:37 |
| Message-ID: | 022401c334be$04a2e200$0000fea9@russwin |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hi,
I'm trying to write a very simple SQL function, but I'm having problems
with it. My function is as follows:
CREATE OR REPLACE FUNCTION fnCPUpdateVolunteerType(int, text) RETURNS
INTEGER AS '
UPDATE vblVolunteerType
SET vchDisplayName = ''$2''
WHERE intVolunteerTypeID= $1;
SELECT 1;
' LANGUAGE SQL;
A very simple update function which gets accepted with no problems.
Then when I run something like this:
SELECT fnCPUpdateVolunteerType(17, 'Test');
The value of vchDisplayName in the applicable row gets set to '$2'.
I know I'm getting something very simple wrong but I can't figure it out
and I can't find anything in the documentation. Any help would be
greatly appreciated.
Russell Brown.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jan Wieck | 2003-06-17 10:51:15 | Re: full featured alter table? |
| Previous Message | Paul Thomas | 2003-06-17 10:47:28 | Re: Postgres performance comments from a MySQL user |