Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Value of java.sql.PreparedStatement.executeUpdate when there are triggers

807569Jul 7 2006 — edited Jul 10 2006
The 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 ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 7 2006
Added on Jul 7 2006
8 comments
1,329 views