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

From: David Wheeler <david(at)kineticode(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PL/pgSQL 'i = i + 1' Syntax
Date: 2006-05-16 23:40:14
Message-ID: 252AC17D-1F64-4BE4-8DCE-ACACA261CF5B@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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;
END LOOP;

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2006-05-16 23:42:45 Re: PL/pgSQL 'i = i + 1' Syntax
Previous Message Mark Dilger 2006-05-16 23:37:19 Re: PL/pgSQL 'i = i + 1' Syntax