Implicit Conversion
DECLARE
start_time CHAR(5);
finish_time CHAR(5);
elapsed_time NUMBER(5);
BEGIN
/* Get system time as seconds past midnight. */
SELECT To_char(SYSDATE,'SSSSS')
INTO start_time
FROM sys.dual;
-- processing done here...
/* Get system time again. */
SELECT To_char(SYSDATE,'SSSSS')
INTO finish_time
FROM sys.dual;
/* Compute elapsed time in seconds. */
elapsed_time := finish_time - start_time;
dbms_output.Put_line('Elapsed time: '
||To_char(elapsed_time));
END;
/
0 comments:
Post a Comment