1CREATE OR REPLACE FUNCTION to_date_check_null(dateString IN VARCHAR2,
2 dateFormat IN VARCHAR2) RETURN DATE IS
3BEGIN
4 IF dateString IS NULL THEN
5 return NULL;
6 ELSE
7 return to_date(dateString, dateFormat);
8 END IF;
9END;