Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Elapse Time in PL/SQL Procedure?
Tim Lindsey wrote:
>
> Please reply directly via email. I'm using Oracle 8i (8.1.6 on NT). Thanks!
>
> I want to capture elapse time in a PL/SQL procedure in hours and seconds and
> put it in a variable.
> I tried capturing sysdate at the start and end and subtracting them. That
> didn't work.
> I found the "TIMING START X" command and it seems to do what I want but it
> won't compile in a procedure.
> Can any one help me?
>
> CREATE OR REPLACE PROCEDURE bamb.PR_TEST
> IS
> sum_count NUMBER;
> elapse_time varchar2(25);
> BEGIN
> timing start elapse_time;
> -- do what ever here
> timing stop elapse_time;
> -- output to a table here
> END;
> /
>
> This gets me the following error:
> 10/8 PLS-00103: Encountered the symbol "START" when expecting one of
> the following:
> := . ( @ % ;
at start of pl/sql:
x := dbms_utility.get_time;
at the end:
time_taken := dbms_utility.get_time - x;
HTH
-- =========================================== Connor McDonald http://www.oracledba.co.uk (faster/mirrored at http://www.oradba.freeserve.co.uk) Its not the voices in my head that bother me... its the voices in yours.Received on Fri Oct 13 2000 - 05:36:05 CDT
![]() |
![]() |