Decode function return data type is always the same as its first returned argument.
select decode(hiredt,’09-SEP-1979’,NULL,hiredt)
In the above case the return data type is VARCHAR2, since NULL has a VARCHAR2 data type. In the above case, we can make sure that the return data type is date, by applying a to_date function on the null value.
Bookmarks