Friday, 13 December 2013

Executable Delete Script



/***************************************************
*PURPOSE: DELETE  EXECUTABLE FROM BACK-END  
*AUTHOR: Shravan Purohit 
*SYNTAX:
 DELETE_EXECUTABLE (PROGRAM_SHORT_NAME, APPLICATION_SHORT_NAME)               
***************************************************/

DECLARE
   L_EXE_SHORT_NAME    VARCHAR2 (240);
   L_APPL_SHORT_NAME   VARCHAR2 (240);
BEGIN
   -- SET THE VARIABLES FIRST
   L_EXE_SHORT_NAME := 'XX_MOTRAS_SHORT_EXE'; -- CONCURRENT EXECUTABLE SHORT NAME
   L_APPL_SHORT_NAME := 'PO';                        -- APPLICATION SHORT NAME

   -- SEE IF THE EXECUTABLE EXISTS. IF FOUND, DELETE THE PROGRAM
   IF FND_PROGRAM.EXECUTABLE_EXISTS (LV_EXE_SHORT_NAME, L_APPL_SHORT_NAME)
   THEN
      FND_PROGRAM.DELETE_EXECUTABLE (LV_EXE_SHORT_NAME, L_APPL_SHORT_NAME);

      COMMIT;

      DBMS_OUTPUT.PUT_LINE (L_EXE_SHORT_NAME || ' Deleted Successfully');
   -- IF THE PROGRAM EXECUTABLE DOES NOT EXIST IN THE SYSTEM
   ELSE
      DBMS_OUTPUT.PUT_LINE (L_EXE_SHORT_NAME || ' Not Found');
   END IF;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.PUT_LINE ('Error: ' || SQLERRM);
END;

No comments:

Post a Comment