X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5C5AD9FB3F0 for ; Thu, 31 Aug 2006 12:26:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 02641-04-7 for ; Thu, 31 Aug 2006 12:26:40 -0300 (ADT) X-Greylist: delayed 01:00:16.328308 by SQLgrey- Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) by postgresql.org (Postfix) with ESMTP id 902DD9FB3E3 for ; Thu, 31 Aug 2006 12:21:44 -0300 (ADT) Received: from [192.168.7.5] ([71.101.67.143]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J4V00MMA9752FM0@vms046.mailsrvcs.net> for pgsql-sql@postgresql.org; Thu, 31 Aug 2006 09:21:06 -0500 (CDT) Date: Thu, 31 Aug 2006 10:21:17 -0400 From: Joe Subject: Re: ERROR: SELECT query has no destination for result data In-reply-to: <55c095e90608310600y18d382f2l5cc43410466bbd79@mail.gmail.com> To: Ezequias Rodrigues da Rocha Cc: pgsql-sql@postgresql.org Message-id: <44F6F05D.5040300@freedomcircle.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 8BIT References: <55c095e90608310600y18d382f2l5cc43410466bbd79@mail.gmail.com> User-Agent: Thunderbird 1.5 (X11/20060317) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200608/250 X-Sequence-Number: 26208 Ezequias Rodrigues da Rocha wrote: > Hi list, > > I have a function like this: > > Create OR REPLACE Function base.inserirPontos(char(1), varchar(255), > numeric(12,2), int8, int8, int8 ) returns int4 as > $$ > declare > Operacao alias for $1; > Numero_nota alias for $2; > Valor_nota alias for $3; > PontoVenda_Emissor alias for $4; > Cardpass alias for $5; > Cx_Id alias for $6; > > begin > > -- Validando parâmetros passados na função > > if Operacao <> 'C' then > return 1; > else > select count(id) as numRegistros from base.emissor_ponto_venda > where id = PontoVenda_Emissor; You haven't declared numRegistros. Joe