您的位置:首页 > 其它

存储过程 正式课和迈向课的

2015-11-09 10:34 344 查看
ESI_QIANDAO4MAIXIANG

CREATE OR REPLACE PROCEDURE "ESI_MARKSTATE" (in_QRCode   in varchar2,
in_State    in int,
out_Flag    out number,
out_sqlcode out int,
out_sqlerrm out varchar2) as
/*
范  围:和微众对接
作  用:更新迈向签到课程的“有效到场/合格总裁 "1001:是;1002:否;1003:无名片"”
发生时间:微众调用我们更新签到接口后
最后更新:2015-05-08 pm
*/
the_State    int;
out_the_Flag int;
begin

if in_State = 0 then
the_State := 1001;
elsif in_State = 1 then
the_State := 1002;
elsif in_State = 2 then
the_State := 1003;
end if;

begin

select count(yckb_id)
into out_the_Flag
from tcu_yckb
where yckb_int03 = 1001 -- 已签到
and qrcode = in_QRCode;

if out_the_Flag = 0 then
out_the_Flag := null;
goto InvalidQrCode;
end if;

update tcu_yckb set yckb_int06 = the_State where qrcode = in_QRCode;

out_Flag := 100;
commit;
exception
when others then
out_sqlcode := sqlcode;

out_sqlerrm := sqlerrm;

rollback;
out_Flag := 999;

end;

<<InvalidQrCode>>
if (out_Flag is null) then
out_Flag    := 105; -- 非法的签到二维码
out_sqlerrm := '不可识别的签到二维码,请确认。';
end if;

end;


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: