From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | Lori Corbani <Lori(dot)Corbani(at)jax(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: create function : change name of input parameter |
Date: | 2014-08-20 14:14:06 |
Message-ID: | 53F4AD2E.1090902@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 08/20/2014 07:00 AM, Lori Corbani wrote:
>
> My example:
>
> DROP FUNCTION ACC_setMax();
>
> CREATE OR REPLACE FUNCTION ACC_setMax (
> increment int,
> prefixPart varchar(30) = 'MGI:'
> )
> RETURNS VOID AS
> \$\$
>
>
> BEGIN
>
> /* Increment the max MGI Accession Number by @increment */
> update ACC_AccessionMax
> set maxNumericPart = maxNumericPart + increment
> where prefixPart = prefixPart
> ;
>
>
> END;
> \$\$
> LANGUAGE plpgsql;
>
> GRANT EXECUTE ON FUNCTION ACC_setMax(int,varchar) TO public;
>
> *****
>
> When I change the parameter "prefixPart" to "v_prefixPart"....I get the error.
>
> prefixPart varchar(30) = 'MGI:'
>
> where prefixPart = prefixPart
>
> changed to
>
> v_ prefixPart varchar(30) = 'MGI:'
>
> where prefixPart = v_prefixPart
It worked here on Postgres 9.3 and un-escaping the $.
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Rob Sargent | 2014-08-20 14:15:08 | Re: create function : change name of input parameter |
Previous Message | Adrian Klaver | 2014-08-20 14:10:51 | Re: create function : change name of input parameter |