update count

Started by Chris Velevitchover 20 years ago3 messagesgeneral
Jump to latest
#1Chris Velevitch
chris.velevitch@gmail.com

(for v7.4.5) How do I get the number of rows updated by an update command?

Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
www.flashdev.org.au

#2John DeSoi
desoi@pgedit.com
In reply to: Chris Velevitch (#1)
Re: update count

On Dec 18, 2005, at 3:50 AM, Chris Velevitch wrote:

(for v7.4.5) How do I get the number of rows updated by an update
command?

In general, the UPDATE command tells you the number of updated rows:

Outputs

On successful completion, an UPDATE command returns a command tag of
the form

UPDATE count
The count is the number of rows updated. If count is 0, no rows
matched the condition (this is not considered an error).

http://www.postgresql.org/docs/8.1/interactive/sql-update.html

The actual details of getting this number depends on what client API
you are using to execute the UPDATE command.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

#3Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: John DeSoi (#2)
Re: update count

On Sun, Dec 18, 2005 at 08:55:37AM -0500, John DeSoi wrote:

On Dec 18, 2005, at 3:50 AM, Chris Velevitch wrote:

(for v7.4.5) How do I get the number of rows updated by an update
command?

In general, the UPDATE command tells you the number of updated rows:

See also
http://www.postgresql.org/docs/8.1/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461