From: | "Mattias Kregert" <mattias(at)kregert(dot)se> |
---|---|
To: | "Russ Brown" <postgres(at)dot4dot(dot)plus(dot)com> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Difficulty with quotes |
Date: | 2003-06-17 13:41:10 |
Message-ID: | 03b501c334d6$1d13fa00$09000a0a@kregert.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Change this line:
SET vchDisplayName = ''$2''
To this:
SET vchDisplayName = $2
/Mattias
----- Original Message -----
From: "Russ Brown" <postgres(at)dot4dot(dot)plus(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Tuesday, June 17, 2003 3:04 PM
Subject: [GENERAL] Difficulty with quotes
> 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.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>
From | Date | Subject | |
---|---|---|---|
Next Message | Daniel Seichter | 2003-06-17 13:41:45 | Re: postgreSQL on NAS/SAN? |
Previous Message | Andrew Perrin | 2003-06-17 13:37:10 | Re: Request for advice: Table design |