Hi All,
Attempting to calculate the time difference on a procedure for Start and End time.
Variables v_myTime1 and v_myTime2 work fine and are printed.
But, I can't get v_myTimeResult to print. Can anyone help me here?
TIA,
Tim
Attempting to calculate the time difference on a procedure for Start and End time.
Code:
PROCEDURE... IS
v_myTime1 VARCHAR2(9);
v_myTime2 VARCHAR2(9);
v_myTimeResult VARCHAR2(9);
CURSOR...
BEGIN
--Start time.
SELECT TO_CHAR(sysdate, 'HH24:MI:SS') INTO v_myTime1 FROM dual;
DBMS_OUTPUT.PUT_LINE('Started: ' || v_myTime1);
OPEN
LOOP
etc...
END LOOP
--Finish time.
SELECT TO_CHAR(sysdate, 'HH24:MI:SS') INTO v_myTime2 FROM dual;
DBMS_OUTPUT.PUT_LINE('Completed: ' || v_myTime2);
--Determine time difference.
SELECT TO_CHAR((TO_DATE(v_myTime1, 'HH24:MI:SS') - TO_DATE(v_myTime2, 'HH24:MI:SS')))
INTO v_myTimeResult FROM dual;
DBMS_OUTPUT.PUT_LINE('Time Difference: ' || v_myTimeResult);
END;
Variables v_myTime1 and v_myTime2 work fine and are printed.
But, I can't get v_myTimeResult to print. Can anyone help me here?
TIA,
Tim