Re: What's wrong with this function

From: Najm Hashmi <najm(at)mondo-live(dot)com>
To: Jie Liang <jliang(at)ipinc(dot)com>
Cc: pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: What's wrong with this function
Date: 2001-02-10 20:23:15
Message-ID: 3A85A333.C4DA82EF@mondo-live.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jie Liang wrote:

> I just know you can use implict cursor inside the plpgsql
> e.g
> declare

result text;
tcount int4;

>
> rec record;
> begin
> FOR rec IN select_clause LOOP
> statements
> END LOOP;
> end;
>

Thank you Jie for your help. I am bit confused about how it works. I want for
each row , obtained by select statment, get certain values and then do some
calculations and out put that resulst eg
for rec IN select title, dcount from songs where artist='xyz'
tcount:= tcount+rec.dcount;
END LOOP;
return tcount;
would this work ?
Thanks again for your help.
Regards, Najm

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Najm Hashmi 2001-02-10 21:03:03 String Concatnation
Previous Message Josh Berkus 2001-02-10 19:43:49 16 Argument Limit ?!?!?