-----Check how many program are hold-------------------
SELECT *
FROM fnd_concurrent_requests
WHERE hold_flag = 'Y' AND request_id = NVL(:p_request_id,request_id)
-----all holded program to Unhold---------------------
Update fnd_concurrent_requests SET hold_flag='N'
where hold_flag='Y'
-----------Hold-------------------
Update fnd_concurrent_requests SET hold_flag='Y'
where hold_flag='N'
and request_id
IN(
Select fcr.request_id
FROM apps.fnd_concurrent_requests fcr ,
apps.fnd_user fu ,
apps.fnd_concurrent_programs fcp ,
apps.fnd_concurrent_programs_tl fcpt ,
apps.fnd_printer_styles_tl fpst ,
apps.fnd_conc_release_classes fcrc ,
apps.fnd_responsibility_tl frt ,
apps.fnd_lookups fl
WHERE fcp.application_id = fcpt.application_id
AND fcr.requested_by = fu.user_id
AND fcr.concurrent_program_id = fcp.concurrent_program_id
AND fcr.program_application_id = fcp.application_id
AND fcr.concurrent_program_id = fcpt.concurrent_program_id
AND fcr.responsibility_id = frt.responsibility_id
AND fcr.print_style = fpst.printer_style_name(+)
AND fcr.release_class_id = fcrc.release_class_id(+)
AND fcr.status_code = fl.lookup_code
AND fl.lookup_type = 'CP_STATUS_CODE'
AND fcr.phase_code = 'P'
AND frt.language = 'US'
AND fpst.language = 'US'
AND fcpt.language = 'US')
Commit;
---------------------Unhold--------------------------------
Update fnd_concurrent_requests SET hold_flag='N'
where hold_flag='Y'
and request_id
IN(
Select fcr.request_id
FROM apps.fnd_concurrent_requests fcr ,
apps.fnd_user fu ,
apps.fnd_concurrent_programs fcp ,
apps.fnd_concurrent_programs_tl fcpt ,
apps.fnd_printer_styles_tl fpst ,
apps.fnd_conc_release_classes fcrc ,
apps.fnd_responsibility_tl frt ,
apps.fnd_lookups fl
WHERE fcp.application_id = fcpt.application_id
AND fcr.requested_by = fu.user_id
AND fcr.concurrent_program_id = fcp.concurrent_program_id
AND fcr.program_application_id = fcp.application_id
AND fcr.concurrent_program_id = fcpt.concurrent_program_id
AND fcr.responsibility_id = frt.responsibility_id
AND fcr.print_style = fpst.printer_style_name(+)
AND fcr.release_class_id = fcrc.release_class_id(+)
AND fcr.status_code = fl.lookup_code
AND fl.lookup_type = 'CP_STATUS_CODE'
AND fcr.phase_code = 'P'
AND frt.language = 'US'
AND fpst.language = 'US'
AND fcpt.language = 'US')