set pagesize 3000
set feedback off
set verify off
DEFINE DATEJplus1=&2
DEFINE HeureVague=&3
spool &1
select count(*) "Nombre", 'Filieres a generer avant le traitement de &HeureVague' "Description" from filiere
where
heure_execution is null
and mode_creation=1
and etat_filiere=0
and type_filiere=0
and (( date_com_souhaitee = trunc(sysdate) and to_char (heure_com_souhaitee, 'HH24:MI') >= '&HeureVague' )
OR ( to_char(date_com_souhaitee, 'DD/MM/YYYY') ='&DATEJplus1' and to_char (heure_com_souhaitee, 'HH24:MI') <= '&HeureVague') )
/
select id_filiere from filiere
where
heure_execution is null
and mode_creation=1
and etat_filiere=0
and type_filiere=0
and (( date_com_souhaitee = trunc(sysdate) and to_char (heure_com_souhaitee, 'HH24:MI') >= '&HeureVague' )
OR ( to_char(date_com_souhaitee, 'DD/MM/YYYY') ='&DATEJplus1' and to_char (heure_com_souhaitee, 'HH24:MI') <= '&HeureVague') )
/
spool off
exit ;