Value of java.sql.PreparedStatement.executeUpdate when there are triggers
807569Jul 7 2006 — edited Jul 10 2006The method in subject will return the number of rows affected by the INSERT, UPDATE or DELETE statement it executes. However, if this SQL statement (affecting say x rows) is issued on a table which has a trigger, and the statement makes the trigger execute, and the trigger for example just does an INSERT (on another table) which affects y rows, then it's y - and not x - which is returned by executeUpdate method.
Is there a proper way to make sure that the value returned by executeUpdate method is always x, that is the number of rows affected by the original statement, that is the value it would have been returned if the table had no triggers ?