Re: FOR ... IN - Mailing list pgsql-general

From Alban Hertroys
Subject Re: FOR ... IN
Date
Msg-id 45504C44.9000309@magproductions.nl
Whole thread Raw
In response to FOR ... IN  ("Alain Roger" <raf.news@gmail.com>)
List pgsql-general
Alain Roger wrote:
> Hi,
>
> Before (in version 8.0.1), i did the following thing and it was working
> well...now (in version 8.1.4) it seems that it does not work anymore...
> problem is with FOR rec IN loop...

Could you elaborate on "does not work"?

> So how can i tell "FOR all RECORDS from select * from articles,
> articletypes, department where ..." LOOP ... ?

Well, seeing as this is apparently the same function you posted about
earlier, I suspect it's the same problem with the DECLARE block.

I rather doubt that FOR .. IN broke between releases.

> CREATE OR REPLACE FUNCTION "public"."SP_U_001" ("TypeOfArticle" varchar)
> RETURNS SETOF "public"."active_articles" AS
> $body$
> DECLARE
>  TypeArt VARCHAR := $1;
>    rec RECORD;
>    res active_articles;
> /**************************************/
> BEGIN


--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

// Integrate Your World //

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: stored procedure / Function
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Header meaning for pg_dump