From: Rodrigo De León <rdeleonp@gmail.com>
To: pgsql-admin@postgresql.org
To: pgsql-sql@postgresql.org
Cc: Karthikeyan Sundaram <skarthi98@hotmail.com>
Subject: Re: [SQL] rowcount function in postgres???
Date: Sat, 7 Apr 2007 12:54:35 -0500
Message-ID: <a55915760704071054u2cdcb6e8l90a18faee47b973c@mail.gmail.com> (raw)
In-Reply-To: <BAY131-W181F25E4A6D4AC7312545FB05B0@phx.gbl>
References: <BAY131-W181F25E4A6D4AC7312545FB05B0@phx.gbl>
On 4/7/07, Karthikeyan Sundaram <skarthi98@hotmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: rdeleonp@gmail.com, pgsql-admin@postgresql.org, skarthi98@hotmail.com
Subject: Re: [SQL] rowcount function in postgres???
In-Reply-To: <a55915760704071054u2cdcb6e8l90a18faee47b973c@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox