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, -- 盤點庫區(qū)
? ? ? ? ? ? ? ? ? null, -- 盤點庫位
? ? ? ? ? ? ? ? ? 0, -- 盤點狀態(tài)
? ? ? ? ? ? ? ? ? 0, -- 未確認
? ? ? ? ? ? ? ? ? operator_code,-- 制單人代碼
? ? ? ? ? ? ? ? ? operator_name,-- 制單人
? ? ? ? ? ? ? ? ? null, -- 審核人代碼
? ? ? ? ? ? ? ? ? null, -- 名字
? ? ? ? ? ? ? ? ? null, -- 時間
? ? ? ? ? ? ? ? ? null, -- 狀態(tài)
? ? ? ? ? ? ? ? ? org_code,-- 機構(gòu)
? ? ? ? ? ? ? ? ? org_name,-- 機構(gòu)
? ? ? ? ? ? ? ? ? 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:?程序包或函數(shù)?insertInventory處于無效狀態(tài)? ?
此處無效是由于END insertInventory;少寫了?insertInventory;?
IS 和 begin 未頂格寫