Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E3D472E004D for ; Thu, 27 Mar 2008 05:28:14 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 33031-06 for ; Thu, 27 Mar 2008 05:28:12 -0300 (ADT) X-Greylist: delayed 00:06:40.411367 by SQLgrey-1.7.5 Received: from web53506.mail.re2.yahoo.com (web53506.mail.re2.yahoo.com [206.190.37.67]) by postgresql.org (Postfix) with SMTP id DB63C2E004A for ; Thu, 27 Mar 2008 05:28:11 -0300 (ADT) Received: (qmail 69254 invoked by uid 60001); 27 Mar 2008 08:21:30 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=GFDnKLdaWpV/B5KJyBfoodh/MRXvUhWSfbUurs+9p0UWwJOzbkOgB4fFzZFFBhndoWD7nBpeXP+0rX5p1wK3ak/qTPZVYi4jGWpuFm8iz+NYxhmkHO5wN0VgbY5IEIRlpc0f5QsgEjaMdHRRBxW6VKct4JjKvM/zrNyfGLD4ZAI=; X-YMail-OSG: M_pxX20VM1kNRbydRVtVkSXLCkk0prIz6Tigd5a8Ais10szWGrPXNQZ.9BMG3eZJekQ_SmM5oxdHQYkHZKve96w2LgBcfS50JNFs3UBHUknPmgHuslK1bcmARYqDNOZntAUUWxOYydvp0zw- Received: from [196.14.186.131] by web53506.mail.re2.yahoo.com via HTTP; Thu, 27 Mar 2008 01:21:30 PDT X-Mailer: YahooMailRC/902.40 YahooMailWebService/0.7.185 Date: Thu, 27 Mar 2008 01:21:30 -0700 (PDT) From: Allan Kamau Subject: Looping the result set in plpythonu To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <170171.66203.qm@web53506.mail.re2.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/249 X-Sequence-Number: 28732 Hi all, Am having trouble finding a way to loop through the records (one by one) of the resultset returned by plpy.execute("myquery") statement. Please show me a a few lines of the looping and how to terminate the loop once no more records are found. Allan. ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs