From: | Jie Liang <jliang(at)ipinc(dot)com> |
---|---|
To: | Roberto Mello <rmello(at)cc(dot)usu(dot)edu> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: PL/PgSQL FOR syntax |
Date: | 2001-02-16 21:32:05 |
Message-ID: | Pine.BSF.4.10.10102161322520.69460-100000@tidal.ipinc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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(at)ipinc(dot)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
>
From | Date | Subject | |
---|---|---|---|
Next Message | Dorin Grunberg | 2001-02-16 21:35:44 | Re: Help Retrieving Latest Record |
Previous Message | Tom Lane | 2001-02-16 21:00:56 | Re: Help Retrieving Latest Record |