Re: Can't see what's wrong with this function?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Can't see what's wrong with this function?
Дата
Msg-id 14699.1156788613@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Can't see what's wrong with this function?  (Bjørn T Johansen <btj@havleik.no>)
Список pgsql-general
=?ISO-8859-1?Q?Bj=F8rn?= T Johansen <btj@havleik.no> writes:
> I am trying to create a function but I don't get further than this and something is already wrong...
> The function so far look like this..:

> CREATE OR REPLACE FUNCTION getNettoHastighet (INTEGER) RETURNS INTEGER AS '
> DECLARE
>     total bigint;
> BEGIN
>     select into tmprec (extract(epoch from sum(Til - Fra)) * 1000.0) as total from Log_stop where OrdreID =
ordreid_valand StopType = 1; 

Don't use plpgsql variable names that conflict with names you use in
your queries.  In this case it's trying to replace "AS total" with
a reference to that plpgsql variable named total.

            regards, tom lane

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

Предыдущее
От: "Brandon Aiken"
Дата:
Сообщение: Precision of data types and functions
Следующее
От: Douglas McNaught
Дата:
Сообщение: Re: Precision of data types and functions