hi I'm unable to create this function, it throws me an error "syntax error near int". I'm using redshift
CREATE OR REPLACE FUNCTION stage.calc_enddate( int, int, timestamp)
    RETURNS timestamp
    LANGUAGE sql
    STABLE
AS $$
declare
 p int := 0;
begin 
    if ($1 >1) then
        select $3       
    end if
end
    
$$;
thanks in advance Sundar
 
     
    