Skip site navigation (1) Skip section navigation (2)

Re: For loop

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: Henry <hensa22(at)yahoo(dot)es>
Cc: Postgres <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: For loop
Date: 2006-12-21 05:49:20
Message-ID: c2d9e70e0612202149v6a28cd06kffc6ab9be66bbd9d@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-es-ayuda
On 12/20/06, Henry <hensa22(at)yahoo(dot)es> wrote:
> Hola listeros, necesito una ayuda
> hay alguna forma para que el for loop avanze de N en N, donde N puede ser
> cualquier valor entero positivo.
>
>

a partir de la version 8.2.0 el for loop incluye la clausula BY

FOR i IN REVERSE 10..1 BY 2 LOOP
    -- some computations here
    RAISE NOTICE 'i is %', i;
END LOOP;

o

FOR i IN 10..1 BY -2 LOOP
    -- some computations here
    RAISE NOTICE 'i is %', i;
END LOOP;


-- 
Atentamente,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
                                       Richard Cook

In response to

  • For loop at 2006-12-21 04:58:06 from Henry

pgsql-es-ayuda by date

Next:From: Jaime CasanovaDate: 2006-12-21 06:53:22
Subject: Re: tipo de dato para los indices
Previous:From: HenryDate: 2006-12-21 04:58:06
Subject: For loop

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group