1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| DEFINE DATEDEP='12/02/2010'
DEFINE DATEFIN='27/03/2010'
set serveroutput on
declare
type tabdates is table of date index by pls_integer;
dates tabdates;
begin
for i in (select value from v$nls_valid_values where parameter='TERRITORY' order by 1) loop
execute immediate 'alter session set nls_territory=''' || i.value || '''';
select DATEJOUR bulk collect into dates
from (select to_date('&&DATEDEP', 'DD/MM/YYYY') - 1 + rownum as DATEJOUR
from dual connect by rownum < to_date('&&DATEFIN', 'DD/MM/YYYY') - to_date('&&DATEDEP', 'DD/MM/YYYY') + 2)
where to_char(DATEJOUR, 'D')=1;
dbms_output.put_line(to_char(dates(1), 'DD/MM/YYYY') || ' : ' || i.value);
end loop;
end;
/ |
Partager