Scunningham99
Programmer
I have the following query which reports on concurrent program output. The problem is I don't want to report and count on rows with the inner join (+), so the count should return 0 and not 1. The date is also NULL
SELECT cpv.user_concurrent_program_name "Concurrent Program Name",
cpv.concurrent_program_name "Program Short Name",
efv.application_name "Application",
cpv.enabled_flag "Enabled Flag",
cpv.output_file_type "Output Format",
fu.user_name "Created By (userid)",
DECODE(efv.execution_method_code,
'I', 'PL/SQL Stored Procedure',
'H', 'Host',
'S', 'Immediate',
'J', 'Java Stored Procedure',
'K', 'Java Concurrent Program',
'M', 'Multi Language Function',
'P', 'Oracle Reports',
'B', 'Request Set Stage Function',
'A', 'Spawned',
'L', 'SQL*Loader',
'Q', 'SQL*Plus',
'E', 'Pearl Concurrent Programm',
'Unknown') "Execution Method",
efv.executable_name "Executable Name",
efv.execution_file_name "Execution Filename",
MAX(fcc.actual_start_date) DATE_last_run , --added 02 Jan 14
count(*) Number_of_times_run -- added 02 Jan 14, joined to fcc for number of times run
FROM fnd_executables_form_v efv,
fnd_concurrent_programs_vl cpv,
fnd_user fu,
fnd_concurrent_requests fcc
WHERE efv.executable_id = cpv.executable_id
AND fcc.concurrent_program_id (+) = cpv.concurrent_program_id
AND efv.application_id = cpv.application_id
AND cpv.created_by = fu.user_id
AND cpv.user_concurrent_program_name like '%LXX%'-- <change it>
GROUP BY cpv.user_concurrent_program_name,cpv.concurrent_program_name,efv.application_name,cpv.enabled_flag,cpv.output_file_type,fu.user_name,
DECODE(efv.execution_method_code,'I', 'PL/SQL Stored Procedure',
'H', 'Host',
'S', 'Immediate',
'J', 'Java Stored Procedure',
'K', 'Java Concurrent Program',
'M', 'Multi Language Function',
'P', 'Oracle Reports',
'B', 'Request Set Stage Function',
'A', 'Spawned',
'L', 'SQL*Loader',
'Q', 'SQL*Plus',
'E', 'Pearl Concurrent Programm',
'Unknown'),
efv.executable_name,efv.execution_file_name
Sy UK
SELECT cpv.user_concurrent_program_name "Concurrent Program Name",
cpv.concurrent_program_name "Program Short Name",
efv.application_name "Application",
cpv.enabled_flag "Enabled Flag",
cpv.output_file_type "Output Format",
fu.user_name "Created By (userid)",
DECODE(efv.execution_method_code,
'I', 'PL/SQL Stored Procedure',
'H', 'Host',
'S', 'Immediate',
'J', 'Java Stored Procedure',
'K', 'Java Concurrent Program',
'M', 'Multi Language Function',
'P', 'Oracle Reports',
'B', 'Request Set Stage Function',
'A', 'Spawned',
'L', 'SQL*Loader',
'Q', 'SQL*Plus',
'E', 'Pearl Concurrent Programm',
'Unknown') "Execution Method",
efv.executable_name "Executable Name",
efv.execution_file_name "Execution Filename",
MAX(fcc.actual_start_date) DATE_last_run , --added 02 Jan 14
count(*) Number_of_times_run -- added 02 Jan 14, joined to fcc for number of times run
FROM fnd_executables_form_v efv,
fnd_concurrent_programs_vl cpv,
fnd_user fu,
fnd_concurrent_requests fcc
WHERE efv.executable_id = cpv.executable_id
AND fcc.concurrent_program_id (+) = cpv.concurrent_program_id
AND efv.application_id = cpv.application_id
AND cpv.created_by = fu.user_id
AND cpv.user_concurrent_program_name like '%LXX%'-- <change it>
GROUP BY cpv.user_concurrent_program_name,cpv.concurrent_program_name,efv.application_name,cpv.enabled_flag,cpv.output_file_type,fu.user_name,
DECODE(efv.execution_method_code,'I', 'PL/SQL Stored Procedure',
'H', 'Host',
'S', 'Immediate',
'J', 'Java Stored Procedure',
'K', 'Java Concurrent Program',
'M', 'Multi Language Function',
'P', 'Oracle Reports',
'B', 'Request Set Stage Function',
'A', 'Spawned',
'L', 'SQL*Loader',
'Q', 'SQL*Plus',
'E', 'Pearl Concurrent Programm',
'Unknown'),
efv.executable_name,efv.execution_file_name
Sy UK