Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: [SQL] rowcount function in postgres???



On 4/7/07, Karthikeyan Sundaram <skarthi98(at)hotmail(dot)com> 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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group