Help ->Diagnostics -> Custom Code -> Personalizations: Execute a Procedure
PROCEDURE XXBEX_BULK_BATCH_DFF_P2(P_BATCH_NO VARCHAR2)
IS
--PRAGMA AUTONOMOUS_TRANSATION;
lv_batch_no VARCHAR2(32) := NULL;
lv_organization_id NUMBER;
-- ** ------------------------------------------------------------------------------------------** --
-- ** XXBEX_BULK_BATCH_DFF_P: If FG Batch NO is showing batch Deatils Form **--
-- ** attribute6 is Bulk Batch Number ** --
-- ** Batch Detail Form : XXBEX_BULK_BATCH_NO_TBL ** --
-- **-------------------------------------------------------------------------------------------** --
CURSOR CUR_BULK
IS
SELECT ATTRIBUTE6 BATCH_NO
,DECODE(gbh.BATCH_STATUS,1,'Pending',2,'WIP',3,'Completed',4,'Closed','Cancelled') STATUS
FROM GME_BATCH_HEADER gbh
WHERE rownum=1
AND ATTRIBUTE6 IS NOT NULL
AND gbh.BATCH_STATUS IN ('1','2','3')
--AND recipe_no = P_RECIPE_NO
AND BATCH_NO = P_BATCH_NO
FOR UPDATE;
BEGIN
SELECT attribute6,organization_id
INTO lv_batch_no ,lv_organization_id
FROM GME_BATCH_HEADER gbh
WHERE rownum=1
AND ATTRIBUTE6 IS NOT NULL
AND gbh.BATCH_STATUS IN ('1','2','3')
--AND recipe_no = P_RECIPE_NO
AND BATCH_NO = P_BATCH_NO;
BEGIN
--DELETE FROM XXBEX_BULK_BATCH_NO_TBL;
-- COMMIT;
---lv_recipe_no := P_RECIPE_NO;
--DBMS_OUTPUT.PUT_LINE ('RECIPE_NO: '||P_RECIPE_NO );
DBMS_OUTPUT.PUT_LINE ('~FG BATCH NO: '||P_BATCH_NO);
IF lv_batch_no IS NOT NULL
THEN
FOR CUR_B IN CUR_BULK
LOOP
INSERT INTO XXBEX_BULK_BATCH_NO_TBL
(BATCH_NO
,STATUS)
VALUES (
CUR_B.BATCH_NO,
CUR_B.STATUS
--CUR_B.ORDER_NUMBER,
/* NULL,-- ATTRIBUTE1,
NULL,-- ATTRIBUTE2,
NULL,-- ATTRIBUTE3,
NULL,-- ATTRIBUTE4
NULL,-- ATTRIBUTE5,
NULL,-- CUR_TRX_NO_NULL_REC.CREATED_BY,
NULL,-- CUR_TRX_NO_NULL_REC.CREATION_DATE,
NULL,-- CUR_TRX_NO_NULL_REC.LAST_UPDATE_DATE,
NULL,-- CUR_TRX_NO_NULL_REC.LAST_UPDATED_BY,
NULL*/ -- CUR_TRX_NO_NULL_REC.LAST_UPDATE_LOGIN
);
DBMS_OUTPUT.PUT_LINE ('2.BATCH_NO : '||CUR_B.BATCH_NO );
--COMMIT;
END LOOP;
ELSE
UPDATE XXBEX_BULK_BATCH_NO_TBL
SET ORGANIZATION_ID = lv_organization_id;
--WHERE
--COMMIT;
END IF;
--COMMIT;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE('ERROR'||SQLERRM);
--p_status := ('ERROR'||SQLERRM);
NULL;
END;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE('MAIN ERROR'||SQLERRM);
--p_status := ('ERROR'||SQLERRM);
NULL;
END XXBEX_BULK_BATCH_DFF_P2;
END XXBEX_BULK_BATCH_DFF_PKG;
/