Re: PL/pgSQL 'i = i + 1' Syntax

Поиск
Список
Период
Сортировка
От David Wheeler
Тема Re: PL/pgSQL 'i = i + 1' Syntax
Дата
Msg-id 252AC17D-1F64-4BE4-8DCE-ACACA261CF5B@kineticode.com
обсуждение исходный текст
Ответ на Re: PL/pgSQL 'i = i + 1' Syntax  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: PL/pgSQL 'i = i + 1' Syntax  ("Jaime Casanova" <systemguards@gmail.com>)
Список pgsql-hackers
On May 16, 2006, at 16:30, Andrew Dunstan wrote:

> It ought to be illegal to modify the loop control variable anyway,  
> IMNSHO - it certainly is in Ada, the distant antecedent of pl/pgsql.

I agree, but I must say that it's incredibly useful to be able to  
increment by two as I go through a loop:
    FOR i IN 1 + offset .. 11 + offset LOOP        total := total + substring(ean, i, 1)::INTEGER;        i = i + 1;
ENDLOOP;
 

Best,

David


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

Предыдущее
От: Mark Dilger
Дата:
Сообщение: Re: PL/pgSQL 'i = i + 1' Syntax
Следующее
От: Mark Dilger
Дата:
Сообщение: Re: PL/pgSQL 'i = i + 1' Syntax