首页 > 数据库 >Oracle INV现用量,可保留量,可处理量

Oracle INV现用量,可保留量,可处理量

时间:2024-03-19 09:35:48浏览次数:28  
标签:control return INV number qty 处理量 lot Oracle id

create or replace procedure get_inv_quantity(p_organization_id in number,
p_inventory_item_id in number,
p_lot_number in varchar2,
p_subinventory_code in varchar2,
p_locator_id in number,
x_onhand_qty out number,
x_reservable_qty out number,
x_transactable_qty out number) is

l_return_status varchar2(1);
l_msg_count number;
l_msg_data varchar2(2000);
l_is_revision_control boolean := true;
l_is_lot_control boolean := true;
l_is_serial_control boolean := false;
p_revision varchar2(100);

l_qoh number;
l_rqoh number;
l_qr number;
l_qs number;
l_att number;
l_atr number;
p_lpn_id number;

begin

if p_lot_number is null then
l_is_lot_control := false;
end if;

if p_locator_id is null then
l_is_lot_control := false;
end if;

inv_quantity_tree_pub.query_quantities(p_api_version_number => 1.0,
p_init_msg_lst => 'F',
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_organization_id => p_organization_id,
p_inventory_item_id => p_inventory_item_id,
p_tree_mode => 1,
p_is_revision_control => false, -- no revision control
p_is_lot_control => l_is_lot_control,
p_is_serial_control => l_is_serial_control,
p_demand_source_type_id => 2,
p_revision => null,
p_lot_number => p_lot_number,
p_lot_expiration_date => sysdate,
p_subinventory_code => p_subinventory_code,
p_locator_id => p_locator_id,
p_onhand_source => 3,
x_qoh => l_qoh,
x_rqoh => l_rqoh,
x_qr => l_qr,
x_qs => l_qs,
x_att => l_att,
x_atr => l_atr,
p_lpn_id => null);

if (l_return_status = 'S') then
x_onhand_qty := l_qoh;
x_reservable_qty := l_atr;
else
l_return_status := 'F';
return;
end if;

inv_quantity_tree_pub.query_quantities(p_api_version_number => 1.0,
p_init_msg_lst => 'F',
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_organization_id => p_organization_id,
p_inventory_item_id => p_inventory_item_id,
p_tree_mode => 2,
p_is_revision_control => false, -- no revision control
p_is_lot_control => l_is_lot_control,
p_is_serial_control => l_is_serial_control,
p_demand_source_type_id => 2,
p_revision => null,
p_lot_number => p_lot_number,
p_lot_expiration_date => sysdate,
p_subinventory_code => p_subinventory_code,
p_locator_id => p_locator_id,
p_onhand_source => 3,
x_qoh => l_qoh,
x_rqoh => l_rqoh,
x_qr => l_qr,
x_qs => l_qs,
x_att => l_att,
x_atr => l_atr,
p_lpn_id => null);

if (l_return_status = 'S') then
x_onhand_qty := l_qoh;
x_transactable_qty := l_att;
else
l_return_status := 'F';
return;
end if;

end get_inv_quantity;

create or replace function get_reservable_qty(p_organization_id number,
p_inventory_item_id number,
p_sub varchar2)
return number is
l_onhand_qty number;
l_reservable_qty number;
l_transactable_qty number;
begin
--p_sub可以为空,为空时,所有库别的可保留数量
get_inv_quantity(p_organization_id => p_organization_id,
p_inventory_item_id => p_inventory_item_id,
p_lot_number => null,
p_subinventory_code => p_sub,
p_locator_id => null,
x_onhand_qty => l_onhand_qty,
x_reservable_qty => l_reservable_qty,
x_transactable_qty => l_transactable_qty);
return l_reservable_qty;
end get_reservable_qty;

标签:control,return,INV,number,qty,处理量,lot,Oracle,id
From: https://www.cnblogs.com/ivenlin/p/18082045

相关文章

  • oracle回收站管理
    查询回收站大小:selectsum(space*8/1024/1024)GBfromdba_recyclebin;selectsum(space*8/1024/1024)GBfromdba_recyclebinwhereoriginal_name='YY';reference中对space的解释:SPACENUMBERNumberofblocksusedbytheobject查看回收站是否开启:SHOWPARAME......
  • oracle数字格式化
    问题起源我们在数据库中存储了利率等信息是小于1的查询出结果后直接转换为字符串,这时候就有问题了比如0.5取出来后变成.5这时候放到前端显得不伦不类。解决to_char修改数字的格式,常用的集中情况如下SELECT1,TO_CHAR(.08,'fm999999999990.00'),'小数格式化'FROMdualUN......
  • Oracle千万级数据处理
    --插入时不产生日志,--altertablecux_mtl_material_vmi2024038nologging;--记录时间--settimingon;declarecursorcurisselectmmt.organization_id,mmt.subinventory_code,mmt.transaction_quantity,mmt.transfer_organization_id,mmt.transfer_subinventory,mmt......
  • Java详细安装教程--Java(jdk)安装附jdk安装包 不用登录oracle官网
    Java详细安装教程--Java(jdk)安装一、java历史简介1991年Sun公司的JamesGosling等人开始开发名称为Oak(橡树)的语言。希望用于控制嵌入在有线电视交换盒、PDA等的微处理器,1994年将Oak语言更名为Java1998年JDK1.2时,更名为Java2Platform分为标准版J2SE,企业版J2EE,微型版J2ME......
  • oracle数据库执行报错:ORA-01861: 文字与格式字符串不匹配
    报错sql:selectto_date(sysdate,'yyyy-mm-dd')afromuser原因是:to_date()函数第一个参数,要求的是一个字符串格式,当这个值是一个日期格式的时候就会报错,解决方案:方案一:使用to_char(日期,'yyyy-mm-dd')将日期转为字符,再使用to_date(),方案二:修改数据库配置,让数据库隐式......
  • 【ORACLE】查看正在运行的的SQL
    1、查看Oracle正在执行的sql语句SELECTb.sidoracleID,b.username用户名,b.serial#,paddr,sql_text正在执行的SQL,b.machine计算机名称FROMv$processa,v$sessionb,v$sqlareacWHEREa.addr=b.paddrANDb.sql_......
  • Oracle 之:spool 导出 与 sqlldr 导入
    说明,内容均来自AlfredZhao的https://www.cnblogs.com/jyzhao/p/4819884.html(感谢分享),以下仅记录个人操作过程中的关键说明:一.使用sqlplus导出查询结果:1.准备脚本call.sql如果只需要单纯的导出excel或csv,可以PL/SQL中进行查询导出再另存为。这里只是尝试一下sql......
  • Red Hat Enterprise Linux 7 / Oracle Linux 7 安装 MySQL
    如果你的系统只支持RedHatEnterpriseLinux7/OracleLinux7,并且你已经下载了`mysql80-community-release-el7-11.noarch.rpm`包,那么你可以按照以下步骤来安装MySQL:1.首先,使用`rpm`命令来安装`mysql80-community-release-el7-11.noarch.rpm`包:```bashsudorp......
  • 静默快速安装oracle 19c
    静默快速安装oracle19c1.配置yum源1.配置网络yum源1.删除redhat7.0系统自带的yum软件包;rpm-qa|grepyum>oldyum.pkg备份原信息rpm-qa|grepyum|xargsrpm-e--nodeps不检查依赖,直接删除rpm包1232.自行下载所需要的软件包。包名会更新,根据当前最新的下载。......
  • 手把手教使用静默 搭建Oracle 19c 一主一备ADG集群
    一、环境搭建主机IPora19192.168.134.239ora19std192.168.134.2401.配置yum源1.配置网络yum源1.删除redhat7.0系统自带的yum软件包;rpm-qa|grepyum>oldyum.pkg备份原信息rpm-qa|grepyum|xargsrpm-e--nodeps不检查依赖,直接删除rpm包2.自行下载所需要的软......