oracle systimestamp (sysdate) to milliseconds

前端 未结 7 1265
予麋鹿
予麋鹿 2020-12-16 14:15

Could you provide implementation of stored function to get current systimestamp as milliseconds.
Something I can use like

select current_tim         


        
7条回答
  •  情书的邮戳
    2020-12-16 15:10

    Adding to @Mykhaylo Adamovych answer (which looks correct!) here goes a more straightforward approach using oracle Java support (i.e. not in XE and not in AWS RDS). Less portable (in case you care), but seemed faster in my testing.

    CREATE or replace FUNCTION current_java_timestamp RETURN number
    AS LANGUAGE JAVA NAME 'java.lang.System.currentTimeMillis() return java.lang.Long';
    /
    

提交回复
热议问题