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 26 27 28 29 30 31 32 33
| declare
V_ANNEES varchar2(250);
cursor C1 is
select ANNEE,
CA,
CODE_BU,
CODE_FOURNISSEUR,
CODE_PRODUIT,
FLAG_ECUBE,
date_modif,
nvl(date_export_ecube, date_modif - 1) date_export_ecube
from CA
where ((FLAG_ECUBE in ('C', 'M') ))
and CODE_BU = 'ACS'
and ANNEE in V_ANNEES ;
begin
V_ANNEES:= '2005,2006';
V_ANNEES:= replace(V_ANNEES,',',''',''');
V_ANNEES:=rpad(V_ANNEES,length(V_ANNEES)+2,''')');
V_ANNEES:=lpad(V_ANNEES,length(V_ANNEES)+2,'(''');
dbms_output.put_line(V_ANNEES);
for r_c1 in C1 loop
dbms_output.put_line(r_c1.annee||r_c1.ca||r_c1.CODE_BU);
end loop;
end; |
Partager