List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 14 2002 3:51pm
Subject:Re: Making UPDATE return the no. of rows matched
View as plain text  
At 10:41 +0100 3/14/02, Rune Steinseth wrote:
>Hi all,
>I have changed database for my Java app to MySQL.  The
>app was developed with SQL Server.  Some of the logic
>is dependent on getting the no. of rows updated
>returned after an UPDATE query.  MySQL does only
>return the rows that are really updated, not the rows
>matched of an UPDATE.  This causes problems.
>Is there an easy way to get MySQL always return the
>number of rows matched in an UPDATE?

There's a flag you can set to control this when connecting to the
MySQL server, if you're using the C API or the Perl DBI API.  I
don't think there's an option for this in Java, at least if you're
using the MM.MySQL driver.  It seems to set the CLIENT_FOUND_ROWS
flag unconditionally.  I guess you could change the source and
recompile.

>Regards,
>Rune Steinseth
>
>______________________________________________________
>Sjekk snørapporter...
>fra 500 ski-destinasjoner i Europa
>på http://no.snow.yahoo.com/

Thread
Making UPDATE return the no. of rows matchedRune Steinseth14 Mar
  • Re: Making UPDATE return the no. of rows matchedPaul DuBois14 Mar
    • Re: Making UPDATE return the no. of rows matchedrory oconnor14 May
      • Re: Making UPDATE return the no. of rows matched [from Perl]Paul DuBois14 May
  • Re: Making UPDATE return the no. of rows matched [from Perl]Mark Matthews15 May