set heading off set pagesize 0 set linesize 200 set trimspool on set feedback off set verify off set echo off set termout off set time off set timing off alter session set nls_territory='italy'; UPDATE MNP_DBP2COOP D SET D.FLAG_LAVORATO=0 --da lavorare WHERE D.FLAG_LAVORATO=2; COMMIT; spool &2/iteration_number.txt; select ceil(count(l.MSISDN)/&1) || ';' || floor(((count(l.MSISDN) - t.WORKED)/&1) + 1) from MNP_DBP2COOP l, (select count(*) as WORKED from MNP_DBP2COOP m where m.FLAG_LAVORATO = 0) t group by t.WORKED; spool off / EXIT