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

From: Rodrigo De León <rdeleonp(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Cc: "Karthikeyan Sundaram" <skarthi98(at)hotmail(dot)com>
Subject: Re: [SQL] rowcount function in postgres???
Date: 2007-04-07 17:54:35
Message-ID: a55915760704071054u2cdcb6e8l90a18faee47b973c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Uwe C. Schroeder 2007-04-07 18:58:24 Re: rowcount function in postgres???
Previous Message Michael Fuhr 2007-04-07 17:51:00 Re: rowcount function in postgres???

Browse pgsql-sql by date

  From Date Subject
Next Message Uwe C. Schroeder 2007-04-07 18:58:24 Re: rowcount function in postgres???
Previous Message Michael Fuhr 2007-04-07 17:51:00 Re: rowcount function in postgres???