function error

Поиск
Список
Период
Сортировка
От Travis Hoyt
Тема function error
Дата
Msg-id DBEMKMGOMJAGKAKEPPEGKEANDHAA.thoyt@npc.net
обсуждение исходный текст
Ответы Re: function error  (Jan Wieck <janwieck@yahoo.com>)
Re: function error  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
Список pgsql-sql
CREATE FUNCTION biwklyavg(text, text, text) RETURNS numeric AS '       DECLARE               system          ALIAS $1;
            startdate       ALIAS $2;               enddate         ALIAS $3;               result          numeric;
 
       BEGIN               result := (select (avg(usr) + avg(sys)) from sardata where
systemid = system                       and time between startdate and enddate;       END;
' LANGUAGE 'sql';

Hello,

The fuction listed above gives the following error:

ERROR:  parser: parse error at or near "alias"

I'm running v7.2.  Any ideas?  I pulled this directly from the examples in
the PostgreSQL Developer's Handbook.

Thanks,

Travis

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Non-use of index ?
Следующее
От: "PG Explorer"
Дата:
Сообщение: Re: function error