我有功能是這樣的:Oracle。選擇和功能
CREATE OR REPLACE FUNCTION IntervalToSec(Run_Duration interval day to second) RETURN NUMBER IS
vSeconds NUMBER ;
BEGIN
SELECT EXTRACT(DAY FROM Run_Duration) * 86400
+ EXTRACT(HOUR FROM Run_Duration) * 3600
+ EXTRACT(MINUTE FROM Run_Duration) * 60
+ EXTRACT(SECOND FROM Run_Duration)
INTO
vSeconds
FROM DUAL ;
RETURN vSeconds ;
END;
即間隔數據轉換成總秒數 然後我有選擇查詢:
select RUN_DURATION from SYS.USER_SCHEDULER_JOB_RUN_DETAILS WHERE JOB_NAME = 'WASTE_MESSAGES_JOB' and LOG_DATE > (systimestamp - INTERVAL '0 00:10:00.0'DAY TO SECOND(1))
order by LOG_DATE desc;
輸出像:00 00:00:01.000000 問題是我如何管道查詢結果到功能? 謝謝!
O我的.....這很容易,但我甚至不能:谷歌:corrext的語法!亞歷克斯非常感謝你! –