Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A01179FB4F4; Sat, 7 Apr 2007 14:33:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 39285-04; Sat, 7 Apr 2007 14:33:20 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from bay0-omc3-s36.bay0.hotmail.com (bay0-omc3-s36.bay0.hotmail.com [65.54.246.236]) by postgresql.org (Postfix) with ESMTP id A41859FB4E5; Sat, 7 Apr 2007 14:33:20 -0300 (ADT) Received: from BAY131-W18 ([65.55.136.53]) by bay0-omc3-s36.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sat, 7 Apr 2007 10:33:19 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_bb7ede35-5096-490b-96b5-fa0e9534ea97_" X-Originating-IP: [69.181.160.236] From: Karthikeyan Sundaram To: postgres admin , postgres sql Subject: rowcount function in postgres??? Date: Sat, 7 Apr 2007 10:33:19 -0700 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 07 Apr 2007 17:33:19.0629 (UTC) FILETIME=[D54213D0:01C7793A] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.784 tagged_above=0 required=5 tests=AWL=-1.074, BAYES_40=-0.185, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, HTML_50_60=0.134, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200704/63 X-Sequence-Number: 25127 --_bb7ede35-5096-490b-96b5-fa0e9534ea97_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi, =20 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. =20 In oracle we can say like this =20 begin insert into table_a values (1); if sql%rowcount > 0 then dbms.output.put_line('rows inserted'); else=20 dbms.output.put_line('rows not inserted'); end if; end; =20 Is there something equal to sql%rowcount in postgres? Please help. =20 Regards skarthi =20 _________________________________________________________________ It=92s tax season, make sure to follow these few simple tips=20 http://articles.moneycentral.msn.com/Taxes/PreparationTips/PreparationTips.= aspx?icid=3DWLMartagline= --_bb7ede35-5096-490b-96b5-fa0e9534ea97_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable 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 ro= w 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 inserte= d');
    end if;
end;
 
Is there something equal to sql%rowcount in postgres?   Please he= lp.
 
Regards
skarthi
 


It=92s tax season, make sure to follow these few simp= le tips Check it out!= = --_bb7ede35-5096-490b-96b5-fa0e9534ea97_--