Create date from year, month and day
问题 Does Oracle have a builtin function to create a date from its individual components (year, month and day) that just returns false on missing data? I'm aware of TO_DATE() but I need to compose a string first and neither the || operator nor the CONCAT() function make it easy to handle missing data: -- my_year NUMBER(4,0) NULL SELECT TO_DATE(my_year || '-01-01', 'YYYY-MM-DD') AS my_date FROM my_table; Whenever my_year is NULL we end up with TO_DATE('-01-01', 'YYYY-MM-DD') and: ORA-01841: (full)