The GET_DURATION stored procedure is used to parse seconds into a message for displaying the elapsed time in Days, Hours, Minutes and Seconds.
| Parameter | Description | |
|---|---|---|
| ELAPSED_SECONDS | Type: | OUT |
| Datatype: | NUMBER | |
| Default Value: | 0 | |
| Description | The calculated number of seconds to return to the caller. | |
| ELAPSED_MESSAGE | Type: | OUT |
| Datatype: | VARCHAR2(200) | |
| Default Value: | None | |
| Description | The message displaying the duration to return to the caller. | |
Examples
EXEC IN_DB_UTIL.GET_DURATION(V_TOTAL_SECS, V_ELAPSED_MESSAGE);
SET SERVEROUTPUT ON;
DECLARE
V_ELAPSED_MESSAGE VARCHAR2(200);
BEGIN
IN_DB_UTIL.GET_DURATION(6400, V_ELAPSED_MESSAGE);
DBMS_OUTPUT.PUT_LINE(CHR(10)||'Duration: '||V_ELAPSED_MESSAGE);
END;
/
Example Output
Duration: 1 Hour 46 Minutes 40 Seconds PL/SQL procedure successfully completed.