hi, what is wrong with my newbie sql?

Поиск
Список
Период
Сортировка
От Ronin
Тема hi, what is wrong with my newbie sql?
Дата
Msg-id 1159175758.025535.29770@e3g2000cwe.googlegroups.com
обсуждение исходный текст
Ответы Re: hi, what is wrong with my newbie sql?  (Andreas Kretschmer <akretschmer@spamfence.net>)
Re: hi, what is wrong with my newbie sql?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi, the following sql returns "10" and not "20" as would be expected.

Where is the error? This would for sure work in any programming
language, why is this different?

CREATE FUNCTION test () RETURNS INTEGER AS '

    DECLARE
        k integer;

    BEGIN
        k = 10;
        FOR k IN 1..10 LOOP
            k = k +1;
        END LOOP;

        return k;
    END;

' LANGUAGE 'plpgsql';


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

Предыдущее
От: Ralf Wiebicke
Дата:
Сообщение: Re: in failed sql transaction
Следующее
От: Phillip Tornroth
Дата:
Сообщение: Solution for rolling back many transactions?