Re: Function

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Marcio Farah <marciofarah(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Function
Date: 2017-10-27 13:50:51
Message-ID: 28fec67f-5e63-7a8d-c876-6a07dce38ff6@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 26/10/17 15:00, Marcio Farah wrote:
> Good morning for all
>
> I´m beginer in PL/pgSQL functions and I have one difficulty. The
> function bellow should return many records but return just one. The loop
> just do the first INSERT INTO and get out.

If you run

SELECT substring(cd_geocmu,1,6)::int AS cod_mun FROM
geo_politico.g_br_municipios
WHERE substring(cd_geocmu,1,2)::int = num

by itself (with a suitable value of "num"), do you get more than one row?

Also, what is the definition of the function
parametros.calcula_parametros()?

Ray.

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

In response to

  • Function at 2017-10-26 14:00:58 from Marcio Farah

Browse pgsql-general by date

  From Date Subject
Next Message Weiping Qu 2017-10-27 14:25:13 Re: Question regarding logical replication
Previous Message Tom Lane 2017-10-27 13:29:07 Re: [GENERAL] Postgres 10 manual breaks links with anchors