PROCEDURE CHECK_DUP_BUDGET IS
al_id NUMBER;
vTmp_dup VARCHAR2(1);
BEGIN
IF (:system.record_status in ('INSERT','NEW')) OR
(:bg_reserve_budget.forward_id <> GET_ITEM_PROPERTY( 'BG_RESERVE_BUDGET.FORWARD_ID',DATABASE_VALUE)) OR
(:bg_reserve_budget.fwd_seq <> GET_ITEM_PROPERTY( 'BG_RESERVE_BUDGET.FWD_SEQ',DATABASE_VALUE)) OR
THEN
(:bg_reserve_budget.div_code <> GET_ITEM_PROPERTY( 'BG_RESERVE_BUDGET.DIV_CODE',DATABASE_VALUE))
BEGIN
SELECT 'X'
INTO vTmp_dup
FROM bg_reserve_budget
WHERE ou_code = :parameter.ou_code
AND bg_type = :bg_reserve_master.bg_type
AND reserve_id = :bg_reserve_master.reserve_id
AND forward_id = :bg_reserve_budget.forward_id
AND fwd_seq = :bg_reserve_budget.fwd_seq
AND ROWNUM = 1;
al_id := UTIL.SHOW_MESSAGE('STOP', 'STD', '00004',
GET_ITEM_PROPERTY('BG_RESERVE_BUDGET.FORWARD_ID',PROMPT_TEXT)||' '||:bg_reserve_budget.forward_id||', '||
GET_ITEM_PROPERTY('BG_RESERVE_BUDGET.FWD_SEQ',PROMPT_TEXT)||' '||:bg_reserve_budget.fwd_seq);
--Code %1 Duplicate !!!
COPY(NVL(GET_ITEM_PROPERTY('BG_RESERVE_BUDGET.FORWARD_ID',DATABASE_VALUE),'') ,'BG_RESERVE_BUDGET.FORWARD_ID');
COPY(NVL(GET_ITEM_PROPERTY('BG_RESERVE_BUDGET.FWD_SEQ',DATABASE_VALUE),'') ,'BG_RESERVE_BUDGET.FWD_SEQ');
RAISE FORM_TRIGGER_FAILURE;
EXCEPTION WHEN NO_DATA_FOUND THEN NULL ;
-- WHEN INVALID_NUMBER THEN NULL;
END;
END IF;
END;
ไม่มีความคิดเห็น:
แสดงความคิดเห็น