This is what I use

eval {
    print "Executing DELETE\n" if ($verbose);
    my $del_rows = $dbh_pg->do($pg_query1) or die "prepare failed
DBI::errstr";
    if ($del_rows != 0)
    {
      print "Number of rows deleted: " . $del_rows . "\n";
    } else {
      $del_rows = 0;
    }


-----Original Message-----
From: Amit Saxena [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2008 7:45 PM
To: Perl Beginners
Subject: Count of number of rows returned in delete / update sql in Perl DBI
?

Hi all,

I want to know how to get the count of number of rows returned in delete /
update sql in Perl DBI ?

I have ready some articles on the internet and it states that the "execute"
function returns the number of rows affected though it's not confirmed to
work for all the database.

Is there any solution which will surely work on all databases ?

Thanks & Regards,
Amit Saxena

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to