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;
1CREATE [OR REPLACE] FUNCTION function_name
2 [ (parameter [,parameter]) ]
3
4 RETURN return_datatype
5
6IS | AS
7
8 [declaration_section]
9
10BEGIN
11 executable_section
12
13[EXCEPTION
14 exception_section]
15
16END [function_name];