Re: FOR : Structure control pb

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Guillaume Houssay" <ghoussay(at)noos(dot)fr>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: FOR : Structure control pb
Date: 2003-11-10 12:05:04
Message-ID: 200311101205.05037.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Monday 10 November 2003 11:24, Guillaume Houssay wrote:
> I am using the For controle structure as follows
>
> FOR i IN 0..23 LOOP
>
> query
>
> END LOOP;
>
> The query is tested and is working OK.
>
> When I launch the loop in psql interface, I get the error parse error at or
> near FOR.

The FOR loop is a plpgsql block not an SQL one. You'll need to write a plpgsql
function if you want to use it.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleus Mantzios 2003-11-10 12:18:24 Re: Dynamic Query for System functions - now()
Previous Message Kumar 2003-11-10 11:57:11 Re: Dynamic Query for System functions - now()