Re: Function parameter

Поиск
Список
Период
Сортировка
От John DeSoi
Тема Re: Function parameter
Дата
Msg-id 47DF01B3-95BF-4901-9C7F-BC5F25427334@pgedit.com
обсуждение исходный текст
Ответ на Function parameter  ("Nico Callewaert" <callewaert.nico@telenet.be>)
Список pgsql-general
On Feb 24, 2009, at 5:10 PM, Nico Callewaert wrote:

> I'm trying to modify an input parameter of a function, but I receive
> following error :
>
> ERROR:  "$17" is declared CONSTANT
> CONTEXT:  compile of PL/pgSQL function "update_jobreg" near line 26
>
> Is there a way to modify an input parameter or I have to declare a
> local variable and assign that input parameter to it ?

Declaring a local variable is the best way to do it. You can modify a
parameter if you declare it as INOUT, but you generally only want to
do that if you want to return something from the function.

Note that you can declare and assign the value in a single line in the
DECLARE section of the function, e.g.

text_var text := text_param;



John DeSoi, Ph.D.



В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: High cpu usage after many inserts
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: High cpu usage after many inserts