Kevin Wilson wrote : > >MaxDB 7.5.0.23 on Linux > >Scenario: > >I have a update dbproc that execs multiple update statements >in a SUBTRANS >block and has 4 parameters 3 IN and 1 OUT. > >after each update I set an internally defined VAR N INT using >the following: > >SET N = N + $COUNT; > >After the last update statement and right before SUBTRANS END; >call I set >the out parameter using: > >SET UPDCOUNT = N + $COUNT; > >In my java app I use the following: > >cstmt = conn.prepareCall("{call spUpdateProc(?,?,?,?)}"); >cstmt.setInt(1,Integer.parseInt(sId)); >cstmt.setString(2,sUser); >java.sql.Timestamp tsp = utilClass.getTimestamp(); >cstmt.setTimestamp(3,tsp); >cstmt.registerOutParameter(4,Types.INTEGER); >cstmt.execute(); >int intUpdCount = cstmt.getInt(4); >if(intUpdCount <= 0){<return a no update made message to user>} >else{<return a success message to user>} > >The value of intUpdCount returned is zero. > >Any ideas as why the update counts are not being tallied and set? > >Thanks. > >-- >MaxDB Discussion Mailing List >For list archives: http://lists.mysql.com/maxdb >To unsubscribe: >http://lists.mysql.com/maxdb?>[EMAIL PROTECTED] > >
I tried the following example : create table t1 (s1 int, s2 int) // insert t1 values (1,1) // create dbproc p (in n integer, out c integer) as try c = 0; update dba.t1 set s1 = :n; c = c + $count; n = n + 1; update dba.t1 set s1 = :n where s2 = 1; c = c + $count; catch stop ($rc); // call p (1,?) I received the expected result (2). What's different in your case ? Best Regards, Thomas -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]