⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sp_pstockcheckout.sql

📁 一整套的源代码
💻 SQL
字号:

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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -