1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| set head off
set echo off
set pagesize 0
set feedback off
set serveroutput on size 100000
spool entjob
DECLARE
CURSOR curseur IS
select no_job from entjob where to_char(to_date(date_exec,'J'),'mm/yyyy') =
to_char(sysdate,'mm/yyyy') and substr(file_batch,6,2) in
('00','02','03','04','05','06','07','08','09','10','11','12','13') and no_job is not null
and no_job > 0;
wk_entjob NUMBER(8);
begin
OPEN curseur;
LOOP
FETCH curseur INTO
wk_entjob;
EXIT WHEN CURSEUR%NOTFOUND;
dbms_output.put_line(wk_entjob);
end loop;
close curseur;
end;
/
exit; |