CallableStmt executeUpdate() method doesn't return the actual rows updated
484415Jan 20 2006 — edited Jan 24 2006Hi,
I have an an Function in oracle which updates a table and returns back.
sample code :
BEGIN
UPDATE TEST1 SET ID=12345;
-- RETURN SQL%ROWCOUNT;
RETURN 0
END
When i use CallableStmt object in java to execute this function,
int count = ((PreparedStatement)cstmt1).executeUpdate();
the count returned is always -1 and cstmt1.getUpdateCount() returns 1
whereas the actual rows updated something different (the out param in my java code returns the exact count if i use RETURN SQL%ROWCOUNT)
The same procedures in sybase were returning the exact count with the same piece of java code.
Your help would be highly appreciated.
Thanks in advance,
Mukesh Pujari.