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 8B2B29FA0EB for ; Thu, 31 Aug 2006 11:05:13 -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 93572-04-3 for ; Thu, 31 Aug 2006 11:04:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from a2s5.a2hosting.com (host-209-124-50-10.a2webhosting.com [209.124.50.10]) by postgresql.org (Postfix) with ESMTP id 8102A9FB404 for ; Thu, 31 Aug 2006 10:57:51 -0300 (ADT) Received: from adsl-155-122-205.tys.bellsouth.net ([72.155.122.205] helo=[192.168.1.10]) by a2s5.a2hosting.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.52) id 1GIn3E-0001h1-7P; Thu, 31 Aug 2006 09:57:48 -0400 In-Reply-To: <55c095e90608310600y18d382f2l5cc43410466bbd79@mail.gmail.com> References: <55c095e90608310600y18d382f2l5cc43410466bbd79@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit From: John DeSoi Subject: Re: ERROR: SELECT query has no destination for result data Date: Thu, 31 Aug 2006 09:57:44 -0400 To: Ezequias Rodrigues da Rocha X-Mailer: Apple Mail (2.752.2) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - a2s5.a2hosting.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - pgedit.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.768 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200608/245 X-Sequence-Number: 26203 On Aug 31, 2006, at 9:00 AM, Ezequias Rodrigues da Rocha wrote: > select count(id) as numRegistros from base.emissor_ponto_venda > where id = PontoVenda_Emissor; declare numRegistros as an integer in the declarations section and rewrite the select: select into numRegistros count(id) from base.emissor_ponto_venda where id = PontoVenda_Emissor; See http://www.postgresql.org/docs/8.1/interactive/plpgsql- statements.html#PLPGSQL-SELECT-INTO John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL