Re: error with functions

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: error with functions
Дата
Msg-id 20030921220113.B91581@megazone.bigpanda.com
обсуждение исходный текст
Ответ на error with functions  (shyamperi@davlin.co.in)
Список pgsql-admin
On Mon, 22 Sep 2003 shyamperi@davlin.co.in wrote:

> Dear all,
> This is about the same problem which I have been facing for the past one week and which I am unable to solve.
> I have create a function which return +1 of the argument passed.
> Function Definition:
> CREATE FUNCTION add_one (integer) RETURNS INTEGER AS '
>     BEGIN
>         RETURN $1 + 1;
>     END;
> ' LANGUAGE 'plpgsql';
>
> The output it was giving was always 1, despite any argument ( not string's ofcourse)
> When I viewed the function definition in the pg_proc table...
>
> psql "select proname,prosrc from pg_proc where proname='add_one'"
>  proname |                        prosrc
> ---------+-------------------------------------------------------
>  add_one | BEGIN RETURN   +1 END;
> (1 row)
> ______________
> Can any body tell me why is the $1 missing..
> I am using running postgres 7.3.4 in linux envt
> Have a grate day

How are you creating the function?

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

Предыдущее
От: shyamperi@davlin.co.in
Дата:
Сообщение: error with functions
Следующее
От: shyamperi@davlin.co.in
Дата:
Сообщение: Re: error with functions