row count help
I am connecting to an IBM iSeries DB2 database from a windows platform. I have a simple program which connects from windows and executes some stored procedures on the DB.
I was wondering if there is a function in java which returns the number of rows affected by a certain stored procedure call.
If not, what is the best way to find out the number of rows affected by any particular stored procedure execution?
Thanks.
# 1
I was wondering if there is a function in java which returns the number of rows affected by a certain stored procedure call.
No.
If not, what is the best way to find out the number of rows affected by any particular stored procedure execution?
IF your database provides a tool to obtain this information, the best way would be to determine from this the figure that you need and return it from the sproc. I don't know of such a facility in any of the databases that I use, but I don't know for certain that it doesn't exist.
Note that you may be assuming that this would be "simple" to track, but the side effects of triggers and the like would in fact make it quite complex. It could be done, but I don't know that it is done since it would be of very limited utility.
# 4
>
> If not, what is the best way to find out the number
> of rows affected by any particular stored procedure
> execution?
The best way, and I suspect in general the only way, is to have the stored procedure specifically return a number that tells you what it did.