Re: function

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: "AZL (dot)" <toafzal777(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: function
Date: 2012-12-03 16:55:42
Message-ID: 50BCD98E.8050802@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 30/11/2012 10:25, AZL . wrote:
>
> write a select query and take each row values and do some update or
> insert task postgresql 9.1, can any one give a template of function
> syntax for implementing such a task

You're probably looking for a with...loop construct in plpgsql:

http://www.postgresql.org/docs/9.2/static/plpgsql-control-structures.html#PLPGSQL-RECORDS-ITERATING

You can probably do it with a CTE also, which would avoid the overhead
of calling the function.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

  • function at 2012-11-30 10:25:44 from AZL .

Responses

  • Re: function at 2012-12-03 17:24:42 from Raymond O'Donnell

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2012-12-03 17:24:42 Re: function
Previous Message Jerry LeVan 2012-12-03 15:25:49 Strange Connection Problem….