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: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 13 Oct 2000 11:59:35 +0200
Message-ID: <971431124.11478.8.pluto.d4ee154e@news.demon.nl>

set timing is a sql*plus command, it is available in sql*plus only. I'm not sure why subtracting two dates doesn't work for you, it should without problem.
Alternatively you could use the function dbms_utility.get_timer. This captures the time in milliseconds, since start of the instance.

Regards,

Sybrand Bakker, Oracle DBA

"Tim Lindsey" <timothy.d.lindsey_at_boeing.com> wrote in message news:G2C6JE.EFB_at_news.boeing.com...
> 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:
> := . ( @ % ;
>
>
Received on Fri Oct 13 2000 - 04:59:35 CDT

Original text of this message

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