Oracle 存储过程:这一段存储过程存在什么错误(ORA-03113)
CREATE OR REPLACE PROCEDURE TEST.PR_INFO_PAYCARD
(
vId IN TB_INFO_CARD.ID%TYPE default 0,
vPayId IN TB_INFO_CARD.payid%TYPE,
vAmount IN TB_INFO_CARD.amount%TYPE,
vIsDetail IN TB_INFO_CARD.isdetail%TYPE default 0,
oResint OUT int,
oResStr OUT varchar2
)
IS
i int default 0;
oldIsDetail int default 0;
BEGIN
--检测有没有重复存在
SELECT COUNT(1) INTO i FROM TB_INFO_CARD WHERE ID!=vId AND PayId=vPayId AND Amount=vAmount;
IF i=0 THEN
--添加
IF vId=0 THEN
vId := fn_gen_id('TB_INFO_CARD'); --生成自动递增序列
INSERT INTO TB_INFO_CARD(ID,payid,amount,isdetail) VALUES(vId,vPayId,vAmount,vIsDetail);
COMMIT;
oResInt := 1;
oResStr := '新增成功';
--修改
ELSE
SELECT IsDetail INTO oldIsDetail FROM TB_INFO_CARD WHERE ID=vId;
UPDATE TB_INFO_CARD set payid=vPayId,amount=vAmount,isdetail=vIsDetail WHERE ID=vId;
COMMIT;
oResInt := 1;
oResInt := '修改成功';
END IF;
IF vIsDetail != oldIsDetail and vIsDetail=1 THEN
UPDATE TB_INFO_CARD SET IsDetail=0 WHERE PayId=vPayId AND ID!=vId;
COMMIT;
END IF;
ELSE
oResInt := 0;
oResStr := '已经存在一条重复记录';
END IF;
EXCEPTION WHEN OTHERS THEN
oResInt := 0;
oResStr := '系统错误';
END PR_INFO_PAYCARD;
放到Oracle Toad执行出现红色,提示内容:ORA-03113
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论