如何定义一个值来接收oracle存储过程输出的值
createorreplacePROCEDUREPROCEDURE1(param1INNUMBER,--50param2INNUMBER,--60param3INNUMB...
create or replace PROCEDURE PROCEDURE1( param1 IN NUMBER,--50 param2 IN NUMBER,--60 param3 IN NUMBER,--转账金额 param4 OUT NUMBER --是否成功) ASintval1 NUMBER; intval2 NUMBER;intsal number;BEGIN SELECT count(deptno) into intval1 from dept where deptno= param1; select count(deptno) into intval2 from dept where deptno= param2; if intval1<=0 or intval2<=0 then param4:=1; dbms_output.put_line('账户不存在'); else select sal into intsal from dept where deptno= param1; if intsal< param3 then param4:=2; dbms_output.put_line('用户余额不足'); else update dept set sal=sal+ param3 where deptno= param2; update dept set sal=sal- param3 where deptno= param1; param4:=3; dbms_output.put_line('pk'); commit; end if; end if; END PROCEDURE1;
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询