Search over 650+ Posts

Jul 29, 2015

Parameters and logs for Oracle Concurrent program

Concurrent programs using PL/SQL stored procedures can generate log files or output files.

Your stored procedure concurrent program must have errbuf and retcode as the first two parameters. Use
  1. errbuf to return any error messages, and 
  2. retcode to return completion status. 
The parameter retcode returns
  • 0 for success, 
  • 1 for success with warnings, and 
  • 2 for error. 
After your concurrent program runs, the concurrent manager writes the contents of both errbuf and retcode to the log file associated with your concurrent request.

Example

 /*
This is sample PL/SQL concurrent program submits 10  sub-requests. The sub-requests are submitted one at a time.  Each time a sub-request is submitted, the parent exits to the Running/Paused state, so that it does not consume any resources while waiting for the child request, to complete.  When the child completes the parent is restarted.  */

create or replace procedure parent  (errbuf out varchar2,
                                 retcode   out number) is
   i number;
   req_data varchar2(10);
   r number;

begin
   --
   -- Read the value from REQUEST_DATA.  If this is the
   -- first run of the program, then this value will be
   -- null.
   -- Otherwise, this will be the value that we passed to
   -- SET_REQ_GLOBALS on the previous run.
   --
   req_data := fnd_conc_global.request_data;

   --
   -- If this is the first run, we'll set i = 1.
   -- Otherwise, we'll set i = request_data + 1, and we'll
   -- exit if we're done.
   --
   if (req_data is not null) then
     i := to_number(req_data);
     i := i + 1;
     if (i < 11  ) then
       errbuf := 'Done!';
       retcode := 0 ;
       return;
     end if;
   else
     i := 1;
   end if;

   --
   -- Submit the child request.  The sub_request parameter
   -- must be set to 'Y'.
   --
   r := fnd_request.submit_request('FND', 'CHILD',
                        'Child ' || to_char(i), NULL,
                        TRUE, fnd_conc_global.printer);

   if r = 0 then
     --
     -- If request submission failed, exit with error.
     --
     errbuf := fnd_message.get;
     retcode := 2;
   else
     --
     -- Here we set the globals to put the program into the
     -- PAUSED status on exit, and to save the state in
     -- request_data.
     --
    fnd_conc_global.set_req_globals(conc_status => 'PAUSED',
                                request_data => to_char(i));
    errbuf := 'Sub-Request submitted!';
    retcode := 0 ;
   end if;

   return;

end;

Jul 22, 2015

Queries to check request Group associated with Concurrent Program and Request Set



SELECT
  r.APPLICATION_ID "Request Group Application ID",
  R.REQUEST_GROUP_ID "Request Group - Group ID",
  R.REQUEST_GROUP_NAME,
  R.DESCRIPTION,
  ru.unit_application_id,
  ru.request_group_id "Request Group Unit - Group ID",
  ru.request_unit_id,cp.concurrent_program_id,
  cp.concurrent_program_name,
  cp1.user_concurrent_program_name,
  DECODE(ru.request_unit_type,'P','Program','S','Set',ru.request_unit_type) "Unit Type"
FROM
  apps.fnd_request_groups r,
  apps.fnd_request_group_units ru,
  apps.fnd_concurrent_programs cp,
  apps.FND_CONCURRENT_PROGRAMS_TL cp1
WHERE r.request_group_id = ru.request_group_id
  AND ru.request_unit_id = cp.concurrent_program_id
  AND cp.concurrent_program_id = cp1.concurrent_program_id
  AND cp1.user_concurrent_program_name ='&ENTER_CP_NAME'


SELECT
  R.APPLICATION_ID "Request Group Application ID",
  R.REQUEST_GROUP_ID "Request Group - Group ID",
  R.REQUEST_GROUP_NAME,
  R.DESCRIPTION,
  ru.unit_application_id,
  ru.request_group_id "Request Group Unit - Group ID",
  ru.request_unit_id,
  rs.USER_REQUEST_SET_NAME
FROM
  apps.fnd_request_groups r,
  apps.fnd_request_group_units ru,
  apps.FND_REQUEST_SETS_TL rs
WHERE r.request_group_id = ru.request_group_id
  AND ru.request_unit_id = rs.REQUEST_SET_ID
  AND rs.USER_REQUEST_SET_NAME ='&ENTER_CP_REQUEST_SET_NAME'
 

May 20, 2015

TCA Process flow for managing, searching, creating, and updating customer information


High level process flow for managing, searching, creating, and updating customer information


Source - Oracle TCA Documentations