Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Elapse Time in PL/SQL Procedure?

Re: Elapse Time in PL/SQL Procedure?

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Fri, 13 Oct 2000 18:36:05 +0800
Message-ID: <39E6E595.7A09@yahoo.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US