Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 87CB39FB5DF for ; Sat, 7 Apr 2007 14:54:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 28981-07 for ; Sat, 7 Apr 2007 14:54:35 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.240]) by postgresql.org (Postfix) with ESMTP id B5ECA9FB4E5 for ; Sat, 7 Apr 2007 14:54:36 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id c24so1292790ana for ; Sat, 07 Apr 2007 10:54:35 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kEJOh+J3VdFxwTxdeGwpcIUyP0RAtWDj5jJQYKfIU/gHOVgoFzAZnKng5kwojtPZAnWi0iUyH6lQz6YVREvsvO3f79/7dhMjyd5yoyemXbdV/z3pp/fZGSpskvHDjAfFRAWqh7KCaKaQeJW3Jn/qmpi94CNWVsC2Jm/hY7PiDk0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CW++XZYFl/YhPt/yLF3AuQXk2fuovM4p0WcQL6P8fNbMjU5CEvx8Gb/CL31jhkltkATXbA+W+mx8VkcymY4/8KADxmbcKattku7gi2r9gnz8WED68MLfBP64vReckma/f/ylpaZS7j0vVsgH/1KTTUYPvAEFYnT3bB5hx/X42E0= Received: by 10.100.96.2 with SMTP id t2mr2942742anb.1175968475493; Sat, 07 Apr 2007 10:54:35 -0700 (PDT) Received: by 10.100.177.2 with HTTP; Sat, 7 Apr 2007 10:54:35 -0700 (PDT) Message-ID: Date: Sat, 7 Apr 2007 12:54:35 -0500 From: "=?ISO-8859-1?Q?Rodrigo_De_Le=F3n?=" To: pgsql-admin@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SQL] rowcount function in postgres??? Cc: "Karthikeyan Sundaram" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/65 X-Sequence-Number: 25129 On 4/7/07, Karthikeyan Sundaram wrote: > > Hi, > > I am using 8.1.0 postgres and trying to write a plpgsql block. In that > I am inserting a row. I want to check to see if the row has been inserted > or not. > > In oracle we can say like this > > begin > insert into table_a values (1); > if sql%rowcount > 0 > then > dbms.output.put_line('rows inserted'); > else > dbms.output.put_line('rows not inserted'); > end if; > end; > > Is there something equal to sql%rowcount in postgres? Please help. > > Regards > skarthi Maybe: http://www.postgresql.org/docs/8.2/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW