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

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL timing problem

Re: PL/SQL timing problem

From: stephen O'D <stephen.odonnell_at_gmail.com>
Date: 28 Nov 2006 07:48:35 -0800
Message-ID: <1164728914.972287.277860@h54g2000cwb.googlegroups.com>

Jun wrote:

> Hi guys,
>
> I want to get the elapsed time during the loop, once it is added
> up to 4 seconds I will exit the loop and give a timeout error.
> I am using mod(DBMS_UTILITY.get_time,100), but it seems that it
> was set to 0
> once it gets 100(which is 1 second). I want accumulative time(default
> is 0) that is spend during
> the loop. is there any nice idea about this?
>
>
> Thanks so much for any help:)

Something like this would work:

SQL> l
  1 declare
  2 v_start_time integer default 0;
  3 begin
  4 v_start_time := dbms_utility.get_time;   5 loop

  6      if dbms_utility.get_time - v_start_time > 400 then
  7        exit;
  8      end if;

  9 end loop;
 10* end;
SQL> / PL/SQL procedure successfully completed.

Elapsed: 00:00:04.01 Received on Tue Nov 28 2006 - 09:48:35 CST

Original text of this message

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