Hello Experts,
I am trying to create the below function and getting error, I am creating this function to convert decimal to date
CREATE FUNCTION SDW_STAGE.ICOMS_DATE_CONVERSION
( p_icoms_date int)
RETURNS date LANGUAGE SQLSCRIPT AS
BEGIN
IF p_icoms_date IS NULL THEN
RETURN NULL;
ELSE IF p_icoms_date IN (0,999999) THEN
RETURN NULL;
ELSE
RETURN TO_DATE (p_icoms_date + 19000000, 'YYYY-MM-DD');
END IF;
END;
Please let me know what could be the issue.
Thanks,
Nishith