SELECT DISTINCT PH.PPO_NO
FROM PPO_HD PH
6.if else语句
IF v_ORDER_TYPE = ‘KNBU‘ THEN
........
ELSIF v_ORDER_TYPE=‘KNSP‘ THEN--注意此处是ELSIF,少了一个E
................
END IF;
--以下内容为Package
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE ESCMUSER.KPPO_COMPARE_PACK
IS
--生成PPO对比数据
PROCEDURE p_gen_compare_kppo(v_PPO_NO VARCHAR2,v_PPO_REV_NO NUMBER,v_ORDER_TYPE VARCHAR2, v_UserID VARCHAR2,v_OPERATION_TYPE VARCHAR2);
END KPPO_COMPARE_PACK;
--定义包体
/
CREATE OR REPLACE PACKAGE BODY ESCMUSER.KPPO_COMPARE_PACK
IS
PROCEDURE p_gen_compare_kppo_main(v_COMPARE_HD_ID NUMBER,v_PPO_NO VARCHAR2);
PROCEDURE p_gen_compare_kppo_labdip(v_COMPARE_HD_ID NUMBER,v_PPO_NO VARCHAR2,v_ORDER_TYPE VARCHAR2);
PROCEDURE p_gen_compare_kppo(v_PPO_NO VARCHAR2,v_PPO_REV_NO NUMBER,v_ORDER_TYPE VARCHAR2, v_UserID VARCHAR2,v_OPERATION_TYPE VARCHAR2)
IS
v_COMPARE_HD_ID NUMBER;
BEGIN
..................................
END;