how to get the effected row after execute a query

Started by EazonGuoover 14 years ago2 messages
#1EazonGuo
eazonguo@gmail.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?

--
Best regards

Eazon

#2Pavel Stehule
pavel.stehule@gmail.com
In reply to: EazonGuo (#1)
Re: how to get the effected row after execute a query

Hello

2011/8/19 EazonGuo <eazonguo@gmail.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

Show quoted text

--
Best regards
Eazon