17,082
社区成员
发帖
与我相关
我的任务
分享
create procedure transfer(in_account in number,out_account in number,amount in number)
as
totalDeposit number;
begin
select total into totalDepostit from account where accountnum = out_account;
if totalDeposit >= amount then
update account set total = total - amount where accountnum = out_account;
update account set total = total + amount where accountnum = in_account;
commit;
else
rollback;
end if;
end;