sp_pstockcheckout.sql
来自「一整套的源代码」· SQL 代码 · 共 18 行
SQL
18 行
create or replace function sp_pstockcheckout
(
l_pstockmedicineid in integer,
l_amount in number
)
return integer
is
l_stockamount number(16, 4);
begin
select amount into l_stockamount from pstockmedicine where pstockmedicineid = l_pstockmedicineid;
if l_stockamount < l_amount then
return -1;
end if;
update pstockmedicine set amount = amount - l_amount where pstockmedicineid = l_pstockmedicineid;
return 0;
end;
/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?