Sorry, try
select into numRegistros count(*) from base.emissor_ponto_venda where
id = PontoVenda_Emissor;
The thing you are selecting into needs to match what you are
selecting. So in your examples below, record is needed when you use
"* from ...". If you just need to look at one value:
select into num_em_pdv id from base.emissor_ponto_venda where id =
PontoVenda_Emissor;
John
On Aug 31, 2006, at 10:07 AM, Ezequias Rodrigues da Rocha wrote:
Thank you John,
It only works using records. I don't know why.
When I put ('works well'):
select into num_em_pdv * from base.emissor_ponto_venda where id =
PontoVenda_Emissor;
if num_em_pdv.id is null then --> Se o emissor ponto venda
passado não tem na base retorne 4
retorno:= 4;
When I put (don't works well):
num_em_pdv int4;
select into num_em_pdv * from base.emissor_ponto_venda where id =
PontoVenda_Emissor;
if num_em_pdv.id is null then --> Se o emissor ponto venda
passado não tem na base retorne 4
retorno:= 4;
Reports the error:
ERROR: missing FROM-clause entry for table "num_em_pdv"
CONTEXT: SQL statement "SELECT num_em_pdv.id is null"
PL/pgSQL function "inserirpontos" line 30 at if
Thank you John. I think I should stay with the record type.
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings