From: Alexander B. <burbello3000@yahoo.com.br>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Return record on recursive call
Date: Mon, 28 May 2007 17:06:55 -0300
Message-ID: <465B365F.2010605@yahoo.com.br> (raw)
Hi,
I am creating a function that when finished the last level, should
return for each row.
I put raise notice to trace and the result is correct, but when I try to
execute, an error is showed.
"ERRO: wrong record type supplied in RETURN NEXT"
I created other functions the same way and worked, basically using the
same structure but not recursive.
Is it different return when using recursive.
sample code:
"...
loop
raise notice '' cur1 -> CodCooperativa=% - TipoCoo=%'',
cur1.coo_cod_cooperativa, pTipoCoo;
cur_result.cod_cooperativa = cur1.coo_cod_cooperativa;
cur_result.cooperativa_superior =
cur1.coo_cooperativa_superior;
cur_result.nro_documento = cur1.coo_nro_documento;
cur_result.tipo = cur1.reg_cod_registro;
cur_result.nome_fantasia = cur1.coo_nome_fantasia;
return next cur_result;
..."
Thanks in advance.
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: burbello3000@yahoo.com.br
Subject: Re: Return record on recursive call
In-Reply-To: <465B365F.2010605@yahoo.com.br>
* 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