v_llin的类型为smallint
set v_llin = -999999999999;
set v_err_code=sqlcode;
if v_err_code<>0 THEN
iterate ;
end if;
红字这行会溢出抛异常,问题是抛异常后下面的能不能继续执行
------解决方案--------------------------------------------------------
类似如下的定义,把02000改成溢出时发生的SQLSTATE,把rowcount = 0改成你要的判断条件里的赋值语句
declare not_found CONDITION FOR SQLSTATE '02000';
declare CONTINUE HANDLER FOR not_found
set rowcount = 0;
declare exit handler for sqlexception
call logNote('income_to0206',errLog,sqlcode, sqlstate);