Problem with FOR LOOP query

From: "Greg Quinn" <greg(at)officium(dot)co(dot)za>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Problem with FOR LOOP query
Date: 2007-01-11 19:27:23
Message-ID: 002401c735b6$8e486e60$6501a8c0@melt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I am using EMS's PostGreSQL manager to create a new function using language
SQL and pgSQL

In my function I am trying to declare a variable of type RECORD.

DECLARE curRecord RECORD;

But it gives an error. It also doesn't like my FOR LOOP

FOR curRecord IN SELECT messageid from email_inbox where folderid = $1 LOOP
EXECUTE sp_deleteemailinboxmessagetodeleteditems(curRecord.messageid);
LOOP;

What I don't understand is the documentation says this is how one declares
your variable and the FOR loop but it doesn't work.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2007-01-11 20:26:32 Re: Problem with FOR LOOP query
Previous Message Richard Broersma Jr 2007-01-11 16:34:37 Re: ODBC Linked Table Problems