From: jing han <jing_han_66@yahoo.com>
To: pgsql-interfaces@postgresql.org
Subject: How to retrieve how many rows are affected after doing an INSERT statement
Date: Tue, 12 Apr 2005 08:41:24 -0700 (PDT)
Message-ID: <20050412154124.83434.qmail@web53502.mail.yahoo.com> (raw)
Hello,
When we use PostgreSQL with Perl, we can retrieve
Error messages from database handler, say, if my
database handler is presented as $dbh, then I use
$dbh->errstr() can get error message like:
ERROR: Cannot insert a duplicate key into unique index
a_dbtable_pkey.
Is there a way to retriever from $dbh how many rows
are affected after doing an insert statement, and how
to present this?
I tried $dbh->rowcount(), it doesn't work, So what's
the exact expression?
Any help will be appreciated.
jing
__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
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-interfaces@postgresql.org
Cc: jing_han_66@yahoo.com
Subject: Re: How to retrieve how many rows are affected after doing an INSERT statement
In-Reply-To: <20050412154124.83434.qmail@web53502.mail.yahoo.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