Why user-defined? Why not let the stage generate the SQL? If you did you'd find that it used a better mask for the TO_CHAR() function, one appropriate for a Timestamp data type: SELECT DW_DATE_ID,TO_CHAR(DATE_DT, 'YYYY-MM-DD HH24:MI:SS') FROM STG2D_DATE If you are consistent with your Oracle DATE ha...