1 create or replace function get_count(p_start_date varchar2, p_end_date varchar2) 2 return number is 3 l_count number; 4 begin 5 6 select count(*) 7 into l_count 8 from T_CHAT_UPDATE_LOOKUP c 9 where c.start_date <= TO_DATE(p_start_date, 'yymmdd') 10 and nvl(c.end_date, to_date('991231', 'yymmdd')) >= TO_DATE(p_end_date, 'yymmdd'); 11 12 return l_count; 13 end; 14