Tuesday, 24 June 2014

Submit Concurrent Program through DB Trigger

/* Formatted on 6/24/2014 12:17:43 PM (QP5 v5.115.810.9015) */
CREATE OR REPLACE TRIGGER "APPS"."XX_MERGE_BATCH_TRG"
   AFTER INSERT
   ON xx_merge_batch
   FOR EACH ROW
   WHEN (new.batch_status = 'PENDING')
DECLARE
   req_id   NUMBER;
   result   BOOLEAN;
BEGIN
   result   := fnd_request.set_mode (TRUE);
   req_id   :=
      apps.fnd_request.submit_request ('<CONC_PROG_APPL>',
                                       '<CONC_PROG_SHORT_NAME>',
                                       '',
                                       TO_CHAR (SYSDATE + 30 / 86400,
                                                'DD-MON-YYYY HH24:MI:SS'
                                       ),
                                       FALSE,
                                       :new.batch_id
      );

   IF req_id = 0
   THEN
      raise_application_error (-20160, apps.fnd_message.get);
   END IF;
EXCEPTION
   WHEN OTHERS
   THEN
      NULL;
END;
/

No comments:

Post a Comment