SQL> SQL> create or replace function f_isSunday (in_dt DATE) 2 return VARCHAR2 3 is 4 v_out VARCHAR2(10); 5 begin 6 if to_char(in_dt,'d')=1 then 7 v_out:='Y'; 8 DBMS_OUTPUT.put_line('IsSunday=Y'); 9 end if; 10 return v_out; 11 end; 12 / Function created. SQL> SQL>