set lines 200
set pages 3000
set ver off

SET FEEDBACK   OFF
SET DEFINE   On

DEFINE schema = ''
COLUMN schema_val NOPRINT NEW_VALUE schema
SELECT '&&1' schema_val FROM dual;

DEFINE jobn = ''
COLUMN jobn_val NOPRINT NEW_VALUE jobn
SELECT '&&2' jobn_val FROM dual;

DEFINE runn = ''
COLUMN runn_val NOPRINT NEW_VALUE runn
SELECT '&&3' runn_val FROM dual;

column owner format a15
column job_name format a30
column status format a9
column log_date format a35
column additional_info format a100
column RUN_DURATION format a15
column actual_start_date format a40
column run format 9999
column fail format 9999


select * from (
select log_date,owner,job_name,RUN_DURATION,status,actual_start_date,additional_info
from dba_scheduler_job_run_details
where owner like upper('&schema')
and job_name like upper('&jobn')
order by owner,log_date desc,job_name
)
where rownum <= &runn;

undefine &&1
undefine schema

undefine &&2
undefine jobn

undefine &&3
undefine runn
