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:10:51 |
Message-ID: | 53F4AC6B.8070507@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
>
Can we see the actual sequence in psql with the command outputs?
Also what is escaping the $?
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2014-08-20 14:14:06 | Re: create function : change name of input parameter |
Previous Message | Lori Corbani | 2014-08-20 14:00:00 | Re: create function : change name of input parameter |