i made stored procedure.
when tested workbench call, worked well. if called inside webservice call, got 1217 result. (defined in procedure)
mytable made 3 column (user_no, index, count) , procedure subtracting multiple row's count.
declare _affected_count int default 0; if ( o_ouput1 < i_input1 ) set o_result = 1211; leave proc_body; elseif ( i_input1 > 0 ) set _affected_count = _affected_count + 1; end if; if ( o_ouput2 < i_input2 ) set o_result = 1212; leave proc_body; elseif ( i_input2 > 0 ) set _affected_count = _affected_count + 1; end if; // same input3~input6
update mytable set count = case when index = 1 , i_input1 > 0 , count >= i_input1 count - i_input1 when index = 2 , i_input2 > 0 , count >= i_input2 count - i_input2 when index = 3 , i_input3 > 0 , count >= i_input3 count - i_input3 when index = 4 , i_input4 > 0 , count >= i_input4 count - i_input4 when index = 5 , i_input5 > 0 , count >= i_input5 count - i_input5 when index = 6 , i_input6 > 0 , count >= i_input6 count - i_input6 else count end user_no = i_user_no , index in ( 1, 2, 3, 4, 5, 6 ); if ( row_count() <> _affected_count ) set o_result = 1217; leave proc_body; end if; the problem is.. if call procedure in workbench, works well.
i can't understand why it's different when called workbench , webmethod.
is there can explain this?
i found answer
use affected rows option in on workbench, not webservice default.
http://dev.mysql.com/doc/refman/5.5/en//information-functions.html#function_row-count
Comments
Post a Comment