STEP 1: create or replace and compile java source named mytimestamp as import java.lang.String; import java.sql.Timestamp; public class MyTimestamp { public static String getTimestamp() { return (new Timestamp(System.currentTimeMillis())).toString(); } } STEP 2: CREATE OR REPLACE Function my_timestamp return varchar2 AS LANGUAGE JAVA NAME 'MyTimestamp.getTimestamp() return java.lang.String'; STEP 3: select my_timestamp from dual