pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jie Liang <jliang@ipinc.com>
To: Roberto Mello <rmello@cc.usu.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: PL/PgSQL FOR syntax
Date: Fri, 16 Feb 2001 13:32:05 -0800 (PST)
Message-ID: <Pine.BSF.4.10.10102161322520.69460-100000@tidal.ipinc.com> (raw)
In-Reply-To: <20010216113125.A14323@cc.usu.edu>

Yes,
e.g.
declare
r record;
begin
for r in select statement loop
  r.fieldname can fetch the result from the select statment row by row




Jie LIANG

St. Bernard Software
Internet Products Inc.

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang@ipinc.com
www.stbernard.com
www.ipinc.com

On Fri, 16 Feb 2001, Roberto Mello wrote:

> 	Hi,
> 
> 	What's the correct syntax to access rows in a FOR loop? I'm writing
> a PL/PgSQL doc and seem to be making a mistake somewhere.
> 	I am referring to this:
> 
> 	[<<label>>]
>     FOR record | row IN select_clause LOOP
>         statements
>     END LOOP;
> 
> 	How do I access the rows within the for loop? row.field? 
> 
> 	Thanks,
> 
> 	-Roberto
> -- 
> Computer Science			Utah State University
> Space Dynamics Laboratory		Web Developer
> USU Free Software & GNU/Linux Club 	http://fslc.usu.edu
> My home page - http://www.brasileiro.net/roberto
> 




view thread (2+ messages)

Message-ID: <Pine.BSF.4.10.10102161322520.69460-100000@tidal.ipinc.com>
Permalink:  ../Pine.BSF.4.10.10102161322520.69460-100000@tidal.ipinc.com/
Also on:    postgresql.org/message-id/Pine.BSF.4.10.10102161322520.69460-100000@tidal.ipinc.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: jliang@ipinc.com, rmello@cc.usu.edu
  Subject: Re: PL/PgSQL FOR syntax
  In-Reply-To: <Pine.BSF.4.10.10102161322520.69460-100000@tidal.ipinc.com>
  References: <20010216113125.A14323@cc.usu.edu> <Pine.BSF.4.10.10102161322520.69460-100000@tidal.ipinc.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox