CREATE OR REPLACE PROCEDURE insertInventory(
operator_code varchar2,
operator_name varchar2,
org_code varchar2,
org_name varchar2,
company_code varchar2,
warehouse_code varchar2,
goods_Codestr1 varchar2,
goods_Codestr10 varchar2)
IS
cnt number(11);
BEGIN
select count(view_id) into cnt from V_Storage_goods_report a where
a.GOODS_FULFILL = 0
and ((a.goods_supplynum >0 and a.goods_supplyweight >0) or a.goods_State =2)
and 1 = (case when company_code is null then 1 when a.company_code = company_code then 1 else 0 end)
and 1 = (case when warehouse_code is null then 1 when a.warehouse_code = warehouse_code then 1 else 0 end)
and 1 = (case when goods_Codestr1 is null then 1 when a.goods_Codestr1 = goods_Codestr1 then 1 else 0 end)
and 1 = (case when goods_Codestr10 is null then 1 when a.goods_Codestr10 = goods_Codestr10 then 1 else 0 end);
if (cnt>=0 ) then
insert into Storage_Inventory
(inventory_id,
inventory_billcode,
inventory_date,
goods_state,
goods_date,
company_code,
company_name,
coil_no,
partsname_name,
goods_spec,
goods_material,
productarea_name,
goods_num,
goods_weight,
enter_area_name,
enter_place_name,
collect_code,
collect_name,
collect_date,
inventory_area_name,
inventory_place_name,
inventory_state,
pda_confirm_state,
operator_code,
operator_name,
dataaudit_code,
dataaudit_name,
dataaudit_date,
dataaudit_state,
org_code,
org_name,
warehouse_code,
warehouse_name,
member_code,
remarks)
select Storage_Inventory_seq.Nextval,
'PDDJ' || to_char(sysdate, 'yyyymmddhh24miss') ||Storage_Inventory_seq.Nextval,
sysdate,
a.goods_state,
a.goods_date,
a.company_code,
a.company_name,
a.goods_codestr3,
a.partsname_name,
a.goods_spec,
a.goods_material,
a.productarea_name,
a.goods_num,
a.goods_weight,
a.goods_Codestr10,
a.goods_Codestr1,
null, -- 采集人代码
null, -- 采集人名称
null, -- 采集时间
null, -- 盘点库区
null, -- 盘点库位
0, -- 盘点状态
0, -- 未确认
operator_code,-- 制单人代码
operator_name,-- 制单人
null, -- 审核人代码
null, -- 名字
null, -- 时间
null, -- 状态
org_code,-- 机构
org_name,-- 机构
a.warehouse_code, --仓库代码
null,
a.member_code,
null
from V_Storage_goods_report a
where
a.GOODS_FULFILL = 0
and ((a.goods_supplynum >0 and a.goods_supplyweight >0) or a.goods_State =2)
and 1 = (case when company_code is null then 1 when a.company_code = company_code then 1 else 0 end)
and 1 = (case when warehouse_code is null then 1 when a.warehouse_code = warehouse_code then 1 else 0 end)
and 1 = (case when goods_Codestr1 is null then 1 when a.goods_Codestr1 = goods_Codestr1 then 1 else 0 end)
and 1 = (case when goods_Codestr10 is null then 1 when a.goods_Codestr10 = goods_Codestr10 then 1 else 0 end);
Commit;
end if;
END insertInventory;
ORA-06575: 程序包或函数 insertInventory处于无效状态
此处无效是由于END insertInventory;少写了 insertInventory;
IS 和 begin 未顶格写