Re: FOR : Structure control pb - Mailing list pgsql-sql

From Richard Huxton
Subject Re: FOR : Structure control pb
Date
Msg-id 200311101205.05037.dev@archonet.com
Whole thread Raw
In response to FOR : Structure control pb  ("Guillaume Houssay" <ghoussay@noos.fr>)
List 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


pgsql-sql by date:

Previous
From: "Kumar"
Date:
Subject: Re: Dynamic Query for System functions - now()
Next
From: Achilleus Mantzios
Date:
Subject: Re: Dynamic Query for System functions - now()