select to_char(to_date('2006', 'yyyy'), 'yyyymmdd hh24:mi:ss') from dual;
CREATE OR REPLACE FUNCTION TRY_TO_NUMBER (p_val in varchar2) RETURN NUMBER AS v_number number; BEGIN begin v_number := to_number(p_val); exception when VALUE_ERROR then v_number := 0; end; return v_number; END TRY_TO_NUMBER;