Example Query
Note:
In the following sample Report Template query, spHosts is the same as Hosts, but is specifically for use in stored procedures.
SELECT job_id, c.hostname client, s.hostname server, sc.schedule_name, start_date, finish_date, kilobytes, DECODE(overall_status,0, 'Successful',1,'Partial',3,'Running',4,'Failed', NULL) overall_status,
DECODE(was_restarted,0,'No','Yes') was_restarted, vendor_status, orig_vendor_status, client_resource_name, window_start_date, window_finish_date
FROM TABLE(leg_rtd.listJobSummaryAfterRestart(${startDate},${endDate},100000,
${spHosts},null,null,null)) t, apt_v_server s, apt_v_server c, apt_v_leg_schedule sc
WHERE t.server_id = s.server_id
AND t.client_id = c.server_id
AND t.schedule_id = sc.schedule_id(+) ORDER BY t.start_date