programmers on drugs jeb ORAWTF
FOR r_ccs IN (SELECT time_from, time_to
FROM my_table ccs
WHERE (TO_DATE(TO_CHAR(ccs.time_from, 'DD.MM.YYYY'), 'DD.MM.YYYY') >= v_start_from
AND TO_DATE(TO_CHAR(ccs.time_to, 'DD.MM.YYYY'), 'DD.MM.YYYY') <= v_end_to)
)
LOOP
v_hour := TO_NUMBER(TO_CHAR(r_ccs.time_to, 'HH24'))- TO_NUMBER(TO_CHAR(r_ccs.time_from, 'HH24'));
v_min := TO_NUMBER(TO_CHAR(r_ccs.time_to, 'MI'))- TO_NUMBER(TO_CHAR(r_ccs.time_from, 'MI'));
v_sec := TO_NUMBER(TO_CHAR(r_ccs.time_to, 'SS'))- TO_NUMBER(TO_CHAR(r_ccs.time_from, 'SS'));
v_time := v_time + get_hours(v_sec, v_min, v_hour);
END LOOP;