Re: how to get the effected row after execute a query

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: EazonGuo <eazonguo(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: how to get the effected row after execute a query
Date: 2011-08-19 07:26:50
Message-ID: CAFj8pRBAVgfCzrfFzJScdMdKTqcAmRnBRzLzf5zGyDXYcQ6zGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

2011/8/19 EazonGuo <eazonguo(at)gmail(dot)com>:
> Hello, I have a question. In SQL Server, we can use @@rowcount to get the
> efftected row which record last query 's  effected row .So I have a
> question:
> In Postgresql, how we can get the effected row? Is there some similar
> functions to complete this?
>

It depends on API hat you use. You can use GET DIAGNOSTICS statement
in PL/pgSQL. On client side, you should to use a PQcmdtuples function
or their equivalent (depends on interface).

http://www.postgresql.org/docs/8.4/static/libpq-exec.html#LIBPQ-EXEC-SELECT-INFO

Regards

Pavel Stehule

>
> --
> Best regards
> Eazon
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2011-08-19 09:44:42 Re: [v9.1] sepgsql - userspace access vector cache
Previous Message Shigeru Hanada 2011-08-19 07:19:11 Re: Change format of FDW options used in \d* commands