question about looping through records in plpgsql

From: Michael Davis <michael(dot)davis(at)prevuenet(dot)com>
To: pgsql-general(at)postgreSQL(dot)org
Subject: question about looping through records in plpgsql
Date: 1999-03-04 21:18:18
Message-ID: 93C04F1F5173D211A27900105AA8FCFC145230@lambic.prevuenet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Here is a function that loops through membership records. I have tried many
different variations of this but have not been able to make this work. Has
any one been able to get something similar to this working? Is there any
additional documentation on plpgsql? Is there a another language that would
be better for something like this?

CREATE FUNCTION test(varchar, varchar) RETURNS int2 AS '
DECLARE
options ALIAS FOR $1;
username ALIAS FOR $2;
mid int4;
BEGIN
FOR row IN select * from membership LOOP
statements;
END LOOP;
return 0;
END; ' LANGUAGE 'plpgsql';

Thanks, Michael

Browse pgsql-general by date

  From Date Subject
Next Message Jackson, DeJuan 1999-03-04 21:28:12 RE: [GENERAL] question about looping through records in plpgsql
Previous Message James Thompson 1999-03-04 19:17:57 Re: [INTERFACES] ECPG & 'exec sql connect to' question